2

My application uses Jackson libraries of version 2.8.2 and I added them WEB-INF/LIB directory in my WAR file. As my WildFly (10.0.0.Final) also contains Jackson libraries (old versions) I have decided not to load them by excluding them in the jboss-deployment-structure.xml file as shown below:

<jboss-deployment-structure>
    <deployment>
        <exclude-subsystems>
            <subsystem name="resteasy" />
        </exclude-subsystems>
        <exclusions>
            <module name="org.jboss.resteasy" />
            <module name="org.apache.httpcomponents" />
            <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.jaxrs.jackson-jaxrs-json-provider" />
        </exclusions>
    </deployment>
</jboss-deployment-structure>

But my application is not getting deployed and WildFly throws the following error:

Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.SerializationConfig.withDefaultPrettyPrinter(Lcom/fasterxml/jackson/core/PrettyPrinter;)Lcom/fasterxml/jackson/databind/SerializationConfig;
    at com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(XmlMapper.java:86)
    at com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(XmlMapper.java:67)
    at com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(XmlMapper.java:63)

It seems the WildFly is not excluding the Jackson libraries correctly. Please help.

geekprogrammer
  • 1,108
  • 1
  • 13
  • 39

0 Answers0