java.lang.LinkageError: ClassCastException: attempting to castjar with javax.ws.rs-api
xu20160924 opened this issue · comments
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);
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.
This issue should hopefully be resolved with the latest release, 2.3.8. Please open a new issue if you continue to experience problems.