pingidentity / scim2

The UnboundID SCIM 2.0 SDK for Java
175 stars 72 forks source link

update (PATCH ) operation fails on SCIM2 client after upgrade to Java 17 #201

Closed lbascones closed 10 months ago

lbascones commented 11 months ago

I had no problem using the SCIM client for all types of operations under Java 8, but once I upgraded to Java 17, the updates (PATCH) operations stopped working. The error I get depends on the version of the library I use. The type of reflection that the Jersey library 2.x uses was removed from Java in v16:

java.lang.reflect.InaccessibleObjectException: Unable to make field private static volatile java.net.Authenticator java.net.Authenticator.theAuthenticator accessible: module java.base does not "opens java.net" to unnamed module @5a63f509

Unfortunately, the 3.x versions of Jersey just hangs the thread when creating the client. I tried to use the Apache connector, but that made no difference (no PATCH).

I also tried using Apache CXF as a Jersey substitute, but it also complains about PATCH not being supported:

[java.net.ProtocolException: Invalid HTTP method: PATCH java.net.ProtocolException: Invalid HTTP method: PATCH at java.base/java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:489) at java.base/sun.net.www.protocol.http.HttpURLConnection.setRequestMethod(HttpURLConnection.java:598) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.setRequestMethod(HttpsURLConnectionImpl.java:344) at org.apache.cxf.transport.http.URLConnectionHTTPConduit.setupConnection(URLConnectionHTTPConduit.java:148) at org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit.setupConnection(AsyncHTTPConduit.java:190) at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:505) at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:47) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:710) at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1086)

Is it possible to use the SCIM2 client library with versions of Java after 16?

kqarryzada commented 11 months ago

Thanks for reporting this, @lbascones. It should be possible to use JDK 17 with the SCIM 2 SDK.

What version of the SCIM SDK client library are you using? It looks like Jersey added JDK 17 support in their 2.34 release. Our latest release (2.3.8) uses the 2.39.1 version of Jersey, but older versions of the SCIM SDK used pre-2.34 versions of Jersey. So the only release of the client library that would be compatible is the latest one.

kqarryzada commented 10 months ago

I'm going to resolve this issue, but this can be re-opened if you continue to run into problems.