[ http://jira.codehaus.org/browse/MSUREFIRE-3?page=all ]
Maria Odea Ching moved MNG-1800 to MSUREFIRE-3: ----------------------------------------------- Version: (was: 2.0) Component: (was: maven-surefire-plugin) Workflow: jira (was: Maven) Key: MSUREFIRE-3 (was: MNG-1800) Project: Maven 2.x Surefire Plugin (was: Maven 2) > surefire:test finds a resource inside a jar, but can't load a class inside it? > ------------------------------------------------------------------------------ > > Key: MSUREFIRE-3 > URL: http://jira.codehaus.org/browse/MSUREFIRE-3 > Project: Maven 2.x Surefire Plugin > Type: Bug > Reporter: Matthew Beermann > Priority: Critical > > > We're using Java's SPI mechanism to load implementations at runtime. To be > exact, the iface jar looks for a particular file (using > ClassLoader.getResource) when the application starts, and reads inside of it > to find out what the real implementation is. Then, it uses reflection > (ClassLoader.loadClass) to actually load the class. > This mechanism works like a dream in Eclipse, JUnit, etc, but fails > mysteriously in Maven 2. I say mysteriously, because it locates the file in > the impl jar, but then can't manage to load the class inside that jar! > Snippets from my build log... sorry for the redacting, but it's not > open-source code being built... > [DEBUG] Test Classpath : > ... > [DEBUG] C:\my-implementation.jar > ------------------------------------------------------- > T E S T S > ------------------------------------------------------- > ServiceProviderLookupFacility: The class [BasicLoggerManager] configured in > the service provider configuration file > [jar:file:C:/my-implementation.jar!/META-INF/services/LoggerManager] could > not be found and will be skipped. > ServiceProviderLookupFacility: java.lang.ClassNotFoundException: > BasicLoggerManager > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at > org.codehaus.surefire.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:69) > <where my code called ClassLoader.loadClass> > Any insights into what's going on here? This seems tremendously broken... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]