-
Notifications
You must be signed in to change notification settings - Fork 2.3k
JERSEY-2085 fixed nested jar problem on Jersey. #196
base: 2.21.x
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
I test on tag(2.14) and I think this problem is still in 2.21.x branch. It works on my side, please veriy it. Thanks. |
Hi and thanks for your contribution. As you already probably know, before we can review your pull request, we need you to sign Oracle Contributor Agreement. Also, with exception of changes in the documentation, we need every single patch to be backed by a test proving, that the described functionality was broken and was fixed (among other reasons to ensure, that we don't waste your valuable work by accidentally reverting the behaviour as a side effect of another change). More information about contributing to Jersey can be found at: https://jersey.java.net/scm.html#/Submitting_Patches_and_Contribute_Code Thanks, |
Jenkins, please test this patch. |
Hello @AdamLindenthal, I fix style check problem. Please build and test again, I will send Oralce Contributor Agreement later. |
Thanks, I'll re-trigger it. But please note, that for now, the result of the build is rather informative for you. As I mentioned, we require the patches to be accompanied by at least one (relevant) test. So the build will have to be launched again anyway as soon as you provide one... Regards, |
Jenkins, please test this patch. |
I have send my agreement to Oralce already, I can provide a unit test of this JarZipSchemeResourceFinderFactory. But before that, there is not any unit test on this class.... |
hello @AdamLindenthal, could you tell me which profiles you used of pom 2.21x branch, than I can make a unit test of this class. Before that I test on tag(2.14) with profile includes (default, jdk1.8 and release). |
I see. We are repackaging (an minimizing) the guava library. Just checked quickly and to me it looks like the default profile should work fine. Have you tried to rebuild from the console (e.g. Hope this helps, |
Thanks Adam, mvn clean install -Dmaven.test.skip=true
|
I will test on mvn test, but it spends more time. And I need to go home now. |
Sure, or just run the entire build without the test skipping property. It takes quite long indeed (lots of tests...) PS: I hope you don't feel offended, that I shortened your previous post. The entire reactor summary was too long and would make this thread less readable. |
…eption and block whole application.It will print some warning messages.
… don't throw exception and block whole application.It will print some warning messages.
Don't worry, I understand it, too long log is not meaningful. I do mvn test now, it works |
Hello @AdamLindenthal, can you test it on your jenkins again. we are waiting for your response.... |
Hi Qunfei, sure, I can run the build. However, please be aware, that without the change being tested, we cannot merge it. Have a nice day, |
Jenkins, please test this patch. |
From the screenshot it seems you've sent it to the incorrect address - the correct one is Cheers, |
thanks, i will test later and waiting theire response |
Hi, it's a typo in the address again. You are sending the OCA to oralce instead to oracle... |
thanks , it's a very stupid misktake. |
Hello @AdamLindenthal [INFO] Reactor Summary: BUILD FAILURE Do I need to disable Checkstyle plugin? Best Regards, |
got it, I will check it soon |
I'll take a look @ the code to see if I can help. |
@driverpt feel free to share your issues with @wuqunfei , but please don't contribute any code unless you sign OCA. (I just checked and I don't see your name at http://www.oracle.com/technetwork/community/oca-486395.html; we won't be able to accept the patch if you do that). |
What about changing from
to this
|
Anybody? |
@sheng-wang-i true, but @driverpt is not there. read my message again (https://github.com/jersey/jersey/pull/196#issuecomment-239796496); I stated: X, please work with Y, but (X) don't do any code changes, since you don't have an OCA. Please keep this conversation on topic. |
I will figure out the problem this weekend On 19 Aug 2016 5:06 p.m., "Pavel Bucek" [email protected] wrote:
|
does this problem have been solved? |
+1 |
does this problem have been solved? |
@driverpt, I took your idea and commit it. But I don't have the environment to test it now. If anyone still need it, please test it. The error is still the file Path. |
+1 |
3 similar comments
+1 |
+1 |
+1 |
How is the status ? org.springframework.boot:spring-boot-starter-jersey:jar:1.4.0.RELEASE:compile
|
Caused by: org.glassfish.jersey.server.internal.scanning.ResourceFinderException: java.io.FileNotFoundException: C:\sandbox\playground\JKD\hjd.jar!\BOOT-INF\classes (The system cannot find the path specified) |
I believe it's not working. I can put up my Test Project on GitHub if you want |
So.. after reading tons of posts..etc.. is this resolved? Is it merged? Does it work? I am a wee baffled why almost two years later this is still not in Jersey (or is it?). I honestly dont know what the primary issues is other than "jersey doesnt work in fat jars". I am using Spring boot in my IDE and it seems fine. Is it when I build my spring boot app in to app.jar and deploy it as a fat jar that I am going to run in to trouble?? Is there any possible way to please expedite this. Jersey is a core piece to spring boot micro services for MANY many projects. This should be the hottest priority right now if this is still an issue. |
this change is not merged, since it failed verification. Note this is community contribution, not Jersey team initiative, so we do rely on the activity of the community. Jersey can work in fat jars without any issues. We don't have any test in regards of integration with Spring Boot - we cannot test every framework which chooses to integrate Jersey, so I'm not sure whether presented issue is valid or not. |
Sadly I do not have a solution yet, but if jersey is supposed to work in fat jars, I believe there shouldn't be a big issue resolving this? I mean.. "user-service-0.0.1-SNAPSHOT.jar!\BOOT-INF\classes" states, that it is not able to find any classes in that subfolder of the jar - even though that jar very much does contain .class files in there. Sadly I have not worked with jersey enough to understand it to an extent where I could help out, but perhaps one could somehow use the same technique one would use if jersey without spring was being used? |
I think that this could be fixed by being able to specify the Root Path inside the Jar to where the Classes are. In this case, according to Spring Boot Documentation, it's /BOOT-INF/lib and /BOOT-INF/classes. UPDATE: i think we need to use java.util.JarFile and JarEntry from the root to find the resources. UPDATE 2: After some investigation, i don't think that the current ClassPath Scanning Implementation supports Jar Architectures outside the standards. UPDATE 3: The only way to perform a ClassPath Scanning using the JarEntry, is convert the /BOOT-INF (Spring Boot Example) into a separate Jar Temp File and load it from there. |
Created #250 so that we can create a Custom Resource Finder for Spring Boot that works around this issue. |
this 3 issues could be fixed
1.
spring-projects/spring-boot#1468 (comment)
2.
alexleigh@198687f
3.
https://java.net/jira/browse/JERSEY-2085