Update dependencies Jan. 2022
Closed this issue · 2 comments
redcatbear commented
Situation
When used in combination with the latest BucketFS Java 2.2.0, there is a version conflict in:
org.glassfish:jakarta.json
jakarta.json.bind:jakarta.json.bind
Symptoms
Error message:
org.opentest4j.AssertionFailedError: Unexpected exception thrown: javax.json.JsonException: Provider org.glassfish.json.JsonProviderImpl could not be instantiated: java.lang.ClassCastException: class org.glassfish.json.JsonProviderImpl cannot be cast to class javax.json.spi.JsonProvider (org.glassfish.json.JsonProviderImpl and javax.json.spi.JsonProvider are in unnamed module of loader 'app')
at com.exasol.containertest.featuretests.IT_SyncBugs_2.<init>(IT_SyncBugs_2.java:23)
Caused by: javax.json.JsonException: Provider org.glassfish.json.JsonProviderImpl could not be instantiated: java.lang.ClassCastException: class org.glassfish.json.JsonProviderImpl cannot be cast to class javax.json.spi.JsonProvider (org.glassfish.json.JsonProviderImpl and javax.json.spi.JsonProvider are in unnamed module of loader 'app')
at com.exasol.containertest.featuretests.IT_SyncBugs_2.<init>(IT_SyncBugs_2.java:23)
Caused by: java.lang.ClassCastException: class org.glassfish.json.JsonProviderImpl cannot be cast to class javax.json.spi.JsonProvider (org.glassfish.json.JsonProviderImpl and javax.json.spi.JsonProvider are in unnamed module of loader 'app')
at com.exasol.containertest.featuretests.IT_SyncBugs_2.<init>(IT_SyncBugs_2.java:23)
Acceptance Criteria
- Dependencies updated to the latest stable available on 2022-01-11
jakobbraun commented
Looks like the problem is not that this one is still using javax instead of jakarta and that bucktFs-java is using jakarta in the wrong way(not the api but directly the implementation)
The correct way to use is:
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
<scope>runtime</scope>
</dependency>
jakobbraun commented
We will also have to replace all imports of javax.json
to jakarta.json
in the source code.