Skip to content
This repository has been archived by the owner on May 28, 2018. It is now read-only.

nested jar can't find class path resource. #2357

Open
glassfishrobot opened this issue Sep 7, 2013 · 18 comments
Open

nested jar can't find class path resource. #2357

glassfishrobot opened this issue Sep 7, 2013 · 18 comments

Comments

@glassfishrobot
Copy link

nested jar files structured in the following way:

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

ResourceFinderException occurs.
This is exception stacktrace.

org.glassfish.jersey.server.internal.scanning.ResourceFinderException: java.io.FileNotFoundException: .../boot-jetty.jar!/lib/jersey-spring3-2.2.jar (No such file or directory)
	at org.glassfish.jersey.server.internal.scanning.JarZipSchemeResourceFinderFactory.create(JarZipSchemeResourceFinderFactory.java:86)
	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)

This exception happends because JarZipSchemeResourceFinderFactory is one time split(! last index only).

Affected Versions

[2.2]

@glassfishrobot
Copy link
Author

Reported by otkmnb2783

@glassfishrobot
Copy link
Author

@japod said:
What is the runtime container? Could you please provide a reproducible test case? Thanks in advance!

@glassfishrobot
Copy link
Author

@shamoh said:
Kind reminder - questions by Jakub Podlesak.

@glassfishrobot
Copy link
Author

@mpotociar said:
Linking the related pull request.

@glassfishrobot
Copy link
Author

otkmnb2783 said:
Runtime Continar is Spring-boot.

It can start jersey from a embedded server(Jetty or Tomcat).

@glassfishrobot
Copy link
Author

d0lphin said:
I am experiencing the same problem with Spring Boot 1.0.0.RC3 and Jersey 2.6.
I think I can create a reproducible test case if it's still needed.

@glassfishrobot
Copy link
Author

linusf said:
Spring Boot 1.0.0.RC4 and Jersey 2.7 has the very same issue. Probably introduced somewhere between Jersey 2.5.1 and 2.6.

@glassfishrobot
Copy link
Author

hay_dave said:
There is a work around, but it would be nice not to have to enumerate each JAR file that has packages we want to scan.

spring-projects/spring-boot#1345 (comment)

@glassfishrobot
Copy link
Author

cowwoc said:
According to spring-projects/spring-boot#1468 (comment) this bug affects JAR files embedded in normal WAR files. Consider increasing the priority of this bug.

@glassfishrobot
Copy link
Author

qunfei said:
I have fix this problem on my person jersey verison clone from jersery tag 2.14.(git checkout -b #2357 2.14)

wuqunfei@2effce3
But I don't which jersery branch I could pull request. @cowwoc @hay_dave linusf @d0lphin @marek Potociar

@glassfishrobot
Copy link
Author

svavra said:
We'll take a look at it (hopefully soon).
If possible, create a pull request against the master branch (and possibly 2.x).

@glassfishrobot
Copy link
Author

qunfei said:
the bug was fixed, please merge it.
https://github.com/jersey/jersey/pull/196

@glassfishrobot
Copy link
Author

afranken said:
the fix has been available for months now, what's the holdup here?

@glassfishrobot
Copy link
Author

cowwoc said:
This has been going on for a while now. See https://javaee-guardians.io/lack-of-java-ee-8-progress/

@glassfishrobot
Copy link
Author

@pavelbucek said:
@cowwoc: this has nothing to do with Java EE 8.

@glassfishrobot
Copy link
Author

cowwoc said:
@pavel My point is that ever since Oracle bought Sun (around the time Jersey 2.x was released) there has been a major drop in activity and transparency by Sun/Oracle staff.

I would like nothing more than to have you prove me wrong by increasing the development rate and community support. I'm sure that @afranken would love to know when this pull request will get merged.

@glassfishrobot
Copy link
Author

@pavelbucek said:
@cowwoc

ad 1) this is not the place to discuss that issue, please don't pollute our issue tracker with non-related stuff.
ad 2) I'm no there to "prove you wrong". Honestly, if you are going to give us this kind of attitude, it won't help anything.

OP & pull author:

this issue (including pull request) is on my TODO list now, it should be processed "soon" (read: when I have time). I already assigned it to myself. The pull request itself does not contain any test, I guess that was an issue, but nobody indicated that to the pull request author. Also, providing a test for this issue might be difficult, so I'll see if I can do the test or at least test it manually so I am somehow sure that it won't break anything.

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA JERSEY-2085

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants