Wildfly 9 - 我如何排除杰克逊 [英] Wildfly 9 - How do I exclude Jackson
问题描述
我遇到了一个 Jackson 序列化问题,地图中有空值.显然,这是 Wildfly 9 (
知道如何让它发挥作用吗?
我自己刚刚遇到了这个问题.
在我的应用程序中升级库后,我收到了以下请求错误:
异常处理请求到/path: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.hasToken(Lcom/fasterxml/jackson/core/JsonToken;)
我是这样解决的:
我显然不得不排除wildfly-9提供的jackson-core-2.5.1
.
我用 /opt/wildfly/modules# grep -R 'jackson-core'
然后我在我的 WEB-INF
文件夹中创建了一个 jboss-deployment-structure.xml
:
<部署><排除事项><模块名称="com.fasterxml.jackson.core.jackson-core"/><模块名称="com.fasterxml.jackson.core.jackson-databind"/><模块名称="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider"/><模块名称="org.jboss.resteasy.resteasy-jackson2-provider"/></排除项></部署></jboss-deployment-structure>
I'm running into a Jackson serialization issue with null values in maps. Apparently this is a known bug in the Jackson version used by Wildfly 9 (https://issues.jboss.org/browse/WFLY-4906). I'd like to use the current version of Jackson; however, I'm having trouble excluding the version used by Wildfly. I tried excluding the module in jboss-deployment-structure.xml
but the exclusion is not working.
Any idea how I can get this to work?
I just ran into this issue myself.
After upgrading a library in my application, I received the following error on a request:
Exception handling request to /path: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.hasToken(Lcom/fasterxml/jackson/core/JsonToken;)
Here is how I solved it:
I obviously had to exclude jackson-core-2.5.1
that wildfly-9 provides.
I listed all modules that depend on 'jackson-core' with /opt/wildfly/modules# grep -R 'jackson-core'
Then I created a jboss-deployment-structure.xml
in my WEB-INF
folder:
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="com.fasterxml.jackson.core.jackson-core" />
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
</exclusions>
</deployment>
</jboss-deployment-structure>
这篇关于Wildfly 9 - 我如何排除杰克逊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!