Issue #154 new

FeatureConfigurationUtil.getFilePathFromClasspath uses SystemClassloader

Justin Littman avatarJustin Littman created an issue

fileURI = ClassLoader.getSystemResource(fileName).toURI(); is problematic if an alternate classloader is used.

In my case, the system class loader is not the actual classloader: log.info(ClassLoader.getSystemClassLoader().toString()); log.info(this.getClass().getClassLoader().toString()); yields: 2012-05-10 09:22:48,720 [qtp22527820-73] INFO IdentifyComponent : sun.misc.Launcher$AppClassLoader@16f0472 2012-05-10 09:22:48,720 [qtp22527820-73] INFO IdentifyComponent : org.codehaus.classworlds.RealmClassLoader@7ffe01

Also, the way this is written if the SystemResource is not found, a NPE is thrown.

Comments (1)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.