jersey/jersey — pull request #29 by otkmnb2783 (2013-08-31 02:21:07+00:00)
Title: nested jar can't find class path resource.

When run with 'java -jar nested.jar' the application cannot find class path resource on startup.

java -jar nested.jar

nested.jar
| - lib
| - jersey-spring3-2.2.jar
| - org.glassfish.....

java.io.FileNotFoundException: nested.jar!/lib/jersey-spring3-2.2.jar (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:97)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at java.net.URL.openStream(URL.java:1037)
at org.glassfish.jersey.server.internal.scanning.JarZipSchemeResourceFinderFactory.getInputStream(JarZipSchemeResourceFinderFactory.java:173)
at org.glassfish.jersey.server.internal.scanning.JarZipSchemeResourceFinderFactory.create(JarZipSchemeResourceFinderFactory.java:84)
at org.glassfish.jersey.server.internal.scanning.JarZipSchemeResourceFinderFactory.create(JarZipSchemeResourceFinderFactory.java:64)
at org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.addResourceFinder(PackageNamesScanner.java:280)
at org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.init(PackageNamesScanner.java:196)
at org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.<init>(PackageNamesScanner.java:153)
at org.glassfish.jersey.server.internal.scanning.PackageNamesScanner.<init>(PackageNamesScanner.java:110)
at org.glassfish.jersey.server.ResourceConfig.packages(ResourceConfig.java:665)

That happens because JarZipSchemeResourceFinderFactory is one time split(last index only).