-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jetty application with jersey above 3.1.4 complains wrong java version and crashes #5793
Comments
the very first dependency in your list is
it does not work on JDKs prior to 17. Jersey 3.1.3 and earlier uses Jetty 11 (which works on JDKs lesser than 17) so it does not refer to the dependency you are listing. Jersey 3.1.4 starts to use Jetty 12 which already takes the dependency you are using (12.0.15). So, either stop using incompatible dependencies or use proper JDK. |
I am not sure if you have read my post. I use java 21. What do you mean by "stop using incompatible dependencies"? Could you please point to some documentation which explains the relations? |
I was presuming, that the sentence
means that it works on JDK 21 but fails with some other JDK. If it all refers to the JDK 21, all dependencies are compatible with the used JDK. However, to investigate this further, it would be nice to have some glue on what exactly fails. So, could you please provide some reproducer? |
regarding documentation - a word about changes in Jetty modules can be found here |
3 statements
It might be that the dependencies and the application code are somehow "illegal", but on the other hand, all dependencies are all up-to-date (except for jersey) and all claiming to be compatible with java 21. This is the java version: Concerning reproducer, I will try ... |
basing on your report I've created a simple hello world project with given dependencies and indeed I can confirm that just out of the box it fails while using Jersey 3.1.4, Jetty 12, and JDK 21. I also recall that we had an issue with that release of Jersey (3.1.4) because the release did not respect the proper structure of the Multi-relese jar for the Jetty artifacts. Then I was checking how other versions of Jersey and Jetty 12 start on JDK 21 and for versions since the 3.1.6 till the latest (3.1.9) everything starts fine. So, I enclose the list of my dependencies:
|
Hi, There is also similar issue
I also have to note, that I use maven-assembly-plugin to create a single application jar, and have some suspect, that this might bring some clashes. |
Hi @jarinek, I have some questions:
regarding the issue you are mentioning (#5694), there appeared that Jersey was customly built and had wrong OSGi headers in the MANIFEST.MF that is why the issue was closed without visible resolution. The reporter added this information by e-mail communication. |
I've just tried my reproducer with JDK 21 from Azul Systems:
and it behaves similarly to Open JDK from Oracle: fails for Jersey 3.1.4 (because of the mentioned issue with Multi-Release jar) and runs for versions [3.1.6 : 3.1.9] |
In my case, the dependencies are fetched from a corporate mirror of maven central. There is for sure no custom build in place. The build process runs in gitlab in a k8s runner, i.e., all is fetched and build from scratch. |
@jarinek can you check your .m2 version of the jersey-container-jetty-http jar and see if it contains A workaround is to use jetty11 compatible jersey-container-jetty11-http that has been used with Jersey 3.1.3. |
So, I think you can publish somewhere the and also could you post the output of the |
The result of tree and the analyse maven tasks (the later results confuses me) 34310 [INFO] [1m--- [0;32mdependency:3.8.1:analyze[m [1m(default-cli)[m @ [36mkds[0;1m ---[m |
Maybe this might help instead of upload (it a fetch from the mirror on my desktop) $ cat jersey-container-jetty-http-3.1.9.jar.sha1 $ cksum jersey-container-jetty-http-3.1.9.jar |
Actually, the application does work with jersey 3.1.3 (and I if am not mistaken also with jetty11). Thus it is not a fundamental blocker. |
regarding checksums and SHA1 hash - all correspond to those in the mvn central. |
@jarinek can you confirm that the runtime has the same dependencies you have in the compile time tree above? |
I have an application with the following dependencies
The application positively runs with java 21 but crashes with the following error message
2024-11-08 11:44:13.995 INFO [main] Launcher - java.specification.version:21
2024-11-08 11:44:14.195 INFO [main] Launcher - sun.jnu.encoding:UTF-8
2024-11-08 11:44:14.195 INFO [main] Launcher - java.class.path:/app/kds-3.0.jar
2024-11-08 11:44:14.195 INFO [main] Launcher - java.vm.vendor:Azul Systems, Inc.
..
..
..
2024-11-08 11:44:32.342 ERROR [main] Launcher - Unable to run embedded application server:
jakarta.ws.rs.ProcessingException: Jetty container is not supported on JDK version less than 17.
at org.glassfish.jersey.jetty.JettyHttpContainerFactory.createServer(JettyHttpContainerFactory.java:227) ~[kds-3.0.jar:?]
at org.glassfish.jersey.jetty.JettyHttpContainerFactory.createServer(JettyHttpContainerFactory.java:73) ~[kds-3.0.jar:?]
at de.telekom.bdmp.kds.Launcher.main(Launcher.java:80) [kds-3.0.jar:?]
2024-11-08 11:44:32.440 INFO [main] KeyService - Canceling internal Timer thread
2024-11-08 11:44:32.440 INFO [main] KeyService - Internal Timer thread cancelled
The test has been run for all version 3.1.4 till 3.1.9 with the same result. The highest jersey version which works is 3.1.3
The text was updated successfully, but these errors were encountered: