Closed Generalus closed 5 years ago
Hello @Generalus
JSON-P develop team changed the Maven coordinates from version 1.1.5.
Version | API | Implementation |
---|---|---|
1.1.5 | jakarta.json:jakarta.json-api | org.glassfish:jakarta.json |
Older | javax.json:javax.json-api | org.glassfish:javax.json |
WildFly seems to provide javax.json:javax.json-api
as its module.
On the other hand, the classloader for your application loads jakarta.json:jakarta.json-api
as a transitive dependency of org.glassfish:jakarta.json
.
Both jars have JsonProvider
class and I believe the inconsistency between two different class code triggers the problem. Both Maven and Gradle cannot automatically select proper version because they have different coordinates.
Justify depends on jakarta.json:jakarta.json-api
.
If you stick to the API jar provided by WildFly, it may be safe to exclude the dependency in your build.gradle and use old org.glassfish:javax.json
as the provider as you did. Also you can change the scope of the provider from compile
to runtime
.
Thanks for help!
I hope the problem is successfully solved.
Hello!
We use justify library to validate json messages against draft-07 schema. Environment is Wildfly Application Server 12.
Justify works good, but Wildfly throws error while using security logic:
Our build.gradle:
if we change org.glassfish:jakarta.json:1.1.5:module to org.apache.johnzon:johnzon-core:1.1.12, we get the same error: java.util.ServiceConfigurationError: javax.json.spi.JsonProvider: Provider org.apache.johnzon.core.JsonProviderImpl not a subtype
We have made some experiments with different JSON provider implementations and got working solution with native Wildfly provider: org.glassfish.javax.json
Will be there any issues with org.glassfish.javax.json JSON provider (which is not described as recommended to use in your readme)? Or is there a way to connect your recomended providers with our Wildfly environment properly?