Wildfly and Jackson: LinkageError

自闭症网瘾萝莉.ら 提交于 2019-12-04 06:10:30

WildFly 8 already includes Jackson. Mark the dependency with <scope>provided</scope>. You then need to add a jboss-deployment-structure.xml to your deployment with the following per the documentation.

<jboss-deployment-structure>
    <deployment>
        <exclusions>
           <module name="org.jboss.resteasy.resteasy-jackson-provider"/>
        </exclusions>
        <dependencies>
            <module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure> 

It worked for me when I imported <module name = "com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />, because <module name = "org.jboss.resteasy.resteasy-jackson2-provider" services = "Import" /> does not export it

<jboss-deployment-structure>
      <sub-deployment name="erp-integrator.jar">
        <exclusions>
           <module name="org.jboss.resteasy.resteasy-jackson-provider"/>
        </exclusions>
        <dependencies>
            <module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import" />
            <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
        </dependencies>
    </sub-deployment>
</jboss-deployment-structure> 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!