eclipse-ee4j / jersey

Eclipse Jersey Project - Read our Wiki:
https://github.com/eclipse-ee4j/jersey/wiki
Other
688 stars 351 forks source link

Jetty connector is not supported on JDK version less than 17 #5694

Closed sdyavanapelli closed 1 month ago

sdyavanapelli commented 2 months ago

I am getting below error after upgrading jersey-client 3.1.7 from 3.1.5 and also jersey-jetty-client 3.1.7.

I have read the documentation and I am using java 21 and maven 3.9.6 version.


jakarta.ws.rs.ProcessingException: Jetty connector is not supported on JDK version less than 17.
        at org.glassfish.jersey.jetty.connector.JettyConnectorProvider.getConnector(JettyConnectorProvider.java:83)
        at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:471)
        at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:321)
        at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:834)

pom.xml


 <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>3.1.7</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.connectors</groupId>
            <artifactId>jersey-jetty-connector</artifactId>
            <version>3.1.7</version>
        </dependency>

I have tested my changes with jersey-jetty-connector with version 3.1.6 and 4.0.0.M1 , both of them are working fine but the issue is only with the jersey-jetty-connector : 3.1.7

sdyavanapelli commented 2 months ago

Note : we are loading the org.glassfish.jersey.jetty.connector.JettyConnectorProvider as spi.

jansupol commented 1 month ago

This is weird, jersey-jetty-connector 3.1.7 is almost identical to 3.1.6. Check

sdyavanapelli commented 1 month ago

yes. The error is only coming from 3.1.7 but not in 3.1.6 and 4.0.0-M1 version, but we have to use 3.1.7 version, can you please look into this.

sdyavanapelli commented 1 month ago
Screenshot 2024-07-09 at 8 18 26 PM

It seems that the jersey-jetty-connector-3.1.7 jar is not generating correct profile for jdk 21 , please check.

jansupol commented 1 month ago

That's just confusing. You'd get the same result from 3.1.6. It is a multi-release jar, and the proper classes are in META-INF/versions/17. The class you show is just to warn about using the improper JDK version.

sdyavanapelli commented 1 month ago

I suspect this Line is missing in 3.1.7 version in MANIFEST.MF "META-INF .versions.17.org.glassfish.jersey.jetty.connector;version="3.1.7". can you check the dependency provided in maven repo : https://mvnrepository.com/artifact/org.glassfish.jersey.connectors/jersey-jetty-connector/3.1.7

sdyavanapelli commented 1 month ago

any update @jansupol .

jansupol commented 1 month ago

I can see the Export-Package: contains META-INF.versions.17.org.glassfish.jersey.jetty.connector;version="3.1.7". But that line should not be relevant outside of OSGi.

jansupol commented 1 month ago

@sdyavanapelli You can try 3.1.8 if that helps.

jansupol commented 1 month ago

I am closing this as not an issue in Jersey.