Luke Stevens created SUREFIRE-864:
-------------------------------------

             Summary: NPE when unit test loads resources from JAR
                 Key: SUREFIRE-864
                 URL: https://jira.codehaus.org/browse/SUREFIRE-864
             Project: Maven Surefire
          Issue Type: Bug
    Affects Versions: 2.12, 2.11, 2.10, 2.9
         Environment: Windows 64-bit, Eclipse Maven plug-in
            Reporter: Luke Stevens
         Attachments: TestSurefire.zip

I have a unit test that reads resources from a JAR built by another project. 
This works totally fine when running JUnit within Eclipse. But when building 
under Maven, it hits an error:

java.lang.NullPointerException
at java.io.FilterInputStream.close(FilterInputStream.java:155)
at 
sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.close(JarURLConnection.java:90)
...

Suppressing this error (which occurs on close, after all) only leads to others.

Some digging reveals that this is probably related to a longstanding 
classloader bug in the JVM:
http://stackoverflow.com/questions/3216780/

A very simple project is attached to demonstrate the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to