pingidentity / scim2

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

java.lang.LinkageError: ClassCastException: attempting to castjar with javax.ws.rs-api #156

Closed xu20160924 closed 1 year ago

xu20160924 commented 3 years ago

Describe the bug I face the problem of CLassCastException when I create client via ClientBuilder.newClient(). Stacktrace: java.lang.LinkageError: ClassCastException: attempting to castjar:file:/Users/.gradle/caches/modules-2/files-2.1/javax.ws.rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.jar!/javax/ws/rs/client/ClientBuilder.class to jar:file:/Users/.gradle/caches/modules-2/files-2.1/javax.ws.rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.jar!/javax/ws/rs/client/ClientBuilder.class

To Reproduce Here is my version of these dependencies, by the way I am using gradle. scim2-sdk-client 2.3.0 scim2-sdk-server 2.3.0 javax.ws.rs-api 2.1.1 about jersey 3.0.2

Expected behavior

Additional context The code is below

Client client = ClientBuilder.newClient().register(BceAuthClientSupport.feature("", ""));
WebTarget target = client.target("");
ScimService scimService = new ScimService(target);
kqarryzada commented 1 year ago

I found a couple of reported cases where updating Jersey resolves this problem. I will look into bumping our version of Jersey in the SDK.

kqarryzada commented 1 year ago

This issue should hopefully be resolved with the latest release. Please open a new issue if you continue to experience problems.