I've got an app deployed to a JBoss 7.2
instance that's explicitly using a defined fasterxml.jackson library: 'com.fasterxml.jackson.core:jackson-databind:2.12.6'
However during runtime, I'm getting an error for a different version of jackson: 2.9.10.4-redhat-00001
. The one that's loaded as a JBoss Module.
How do I exclude this from being used by the app completely? I've performed the following and none seem to work:
- Excluding all other jackson libraries from being pulled down from maven.
- Forcing the correct jackson library into the WAR/lib folder during the build.
- Calling out all jackson libraries as
<exclusion></exclusion>
in thejboss-deployment-structure.xml
- I even went as far as converting the app to use
jackson codehaus
but still the error forjackson:2.9.10.4-redhat-00001
persists.
Error
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `java.time.ZonedDateTime` (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value ('2022-01-21T19:00:00Z') at [Source: (org.jboss.resteasy.client.core.BaseClientResponse$InputStreamWrapper); line: 1, column: 12] (through reference chain: com.app.domainobjects.proxy.Object["body"])
at com.fasterxml.jackson.core.jackson-databind@2.9.10.4-redhat-00001//com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
jboss-deployment-structure.xml
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="org.picketbox"/>
<module name="org.wildfly.clustering.singleton"/>
<module name="org.jboss.as.server"/>
<module name="org.jboss.msc"/>
</dependencies>
<exclusions>
<module name="com.fasterxml.classmate" />
<module name="com.fasterxml.jackson.core.jackson-core" />
<module name="com.fasterxml.jackson.core.jackson-annotations" />
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.datatype.jackson-datatype-jdk8" />
<module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
</exclusions>
</deployment>
<sub-deployment name="app.war">
<exclusions>
<module name="com.fasterxml.classmate" />
<module name="com.fasterxml.jackson.core.jackson-core" />
<module name="com.fasterxml.jackson.core.jackson-annotations" />
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.datatype.jackson-datatype-jdk8" />
<module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
</exclusions>
</sub-deployment>
</jboss-deployment-structure>