Modified getPackageClasses to fail gracefully in situations where classpath scanning is not supported.