I am trying to use a newer version of Jackson as JBoss 7 EAP delivers. To solve my issue I have created a jboss-deployment-structure.xml file which is contained in my war deployment.
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<!--<module name="com.fasterxml.jackson.core.jackson-core" slot="main" />-->
<!--<module name="com.fasterxml.jackson.core.jackson-annotations" slot="main" />-->
<module name="com.fasterxml.jackson.core.jackson-databind" slot="main" />
</exclusions>
</deployment>
</jboss-deployment-structure>
But it seems that JBoss uses the delivered module instead of the provided dependency.
ModuleClassLoader for Module "com.fasterxml.jackson.core.jackson-databind:main" from local module loader @134593bf (finder: local module finder @4bb4de6a (roots: ...\jboss-eap-7.0\modules,...\jboss-eap-7.0\modules\system\layers\base))
I have found a similar question JBoss 7 Classloader -- Exclude Module Implementation but it didn't help me.
What did I miss?
It looks like the jax-rs submodule from jboss eap 7 uses jackson. As soon as you skip this submodule, you will get rid of the jboss jackson version:
(only makes sense if you don't use jaxrs ;-)
I ran into the exact same problem with Jackson, and I got it to work in my EAP 7 using this
jboss-deployment-structure.xml
:It appears like as long as any other modules list jackson as their dependency in their respective
module.xml
, it just simply doesn't get excluded, and EAP can't be arsed to even throw a warning about it.Edit 2018-02-19: When upgrading from EAP 7.0.0 to 7.1.0, things broke again, owing to updated Jackson jars.
This is the crucial part of the stacktrace:
So we exclude those as well: