Details
-
Feature Request
-
Resolution: Unresolved
-
Major
-
None
-
18.0.1.Final
-
None
Description
There is a serious problem with using bundled (inside ear) Jackson JSON library in version different than the one included inside WildFly. There are dozens of threads of people trying to solve this issue by manually upgrading modules in WildFly, excluding certain Jackson modules pulled by jaxrs and including them again in custom modules without exporting classes, to (finally) excluding the whole jaxrs subsystem, and using different implementation of JAXRS. Without doing so one can end with the following:
java.lang.NoSuchMethodError: 'com.fasterxml.jackson.core.TSFBuilder com.fasterxml.jackson.core.JsonFactory.builder()'
or
java.lang.IllegalAccessError: class com.fasterxml.jackson.core.JsonFactoryBuilder tried to access private field com.fasterxml.jackson.core.JsonFactory.DEFAULT_ROOT_VALUE_SEPARATOR (com.fasterxml.jackson.core.JsonFactoryBuilder is in unnamed module of loader 'deployment.xyz-ear-1.ear' @b6d0dc5; com.fasterxml.jackson.core.JsonFactory is in unnamed module of loader 'com.fasterxml.jackson.core.jackson-core@2.9.10' @68fc71cf)
Could this be fixed somehow by not exporting Jackson classes from jaxrs/resteasy/jackson2-provider modules? Why do they even get priority before classes from ear classloader?
Found these on the net while trying to solve my issue:
http://alloutfornoloss.com/exclude-jackson-module-wildfly/
https://stackoverflow.com/questions/37616096/wildfly-10-how-to-use-a-newer-version-of-jackson-for-an-aplication
https://stackoverflow.com/questions/38173460/dependency-conflict-loading-jackson-jsr310-under-wildfly
https://stackoverflow.com/questions/47838240/jboss-resteasy-custom-jackson-provider
https://stackoverflow.com/questions/56780117/unknown-conflict-causing-java-lang-nosuchfielderror-write-durations-as-timestam
https://stackoverflow.com/questions/20683843/jackson-annotations-ignored-after-deployment-to-jboss
https://dzone.com/articles/jboss-modules-suck-it%E2%80%99s
https://forum.camunda.org/t/camunda-json-marshalling-and-jsonignore/271/18