杰克逊不穿球衣 [英] Jackson does not work in jersey
问题描述
例外: -
Jun 29, 2015 10:32:20 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [idnsRulesServlet] in context with path [] threw exception [Servlet execution threw an exception] with root cause
java.lang.NoSuchMethodError: org.codehaus.jackson.map.SerializationConfig.isEnabled(Lorg/codehaus/jackson/map/SerializationConfig$Feature;)Z
at org.codehaus.jackson.jaxrs.JacksonJsonProvider.writeTo(JacksonJsonProvider.java:506)
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1479)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
我在使用g jersey 1.17和jackson 1.9.0,jackson-mapper-asl-1.9.13和apache tomcat8。
亲切的帮助我重新开始这个,谢谢
i am using jersey 1.17 and jackson 1.9.0,jackson-mapper-asl-1.9.13 and apache tomcat8. kindly some one help me reslove this , thank you
我的屏幕显示给我的罐子。
my screen is shows to my jars.
推荐答案
NoSuchMethodError
通常意味着混合不兼容的版本。取出所有杰克逊相关的罐子/依赖品,并使用下面的
NoSuchMethodError
often means a mixing of incompatible versions. Take out all the Jackson related jars/dependencies you have and use the below
使用Maven
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.17</version>
</dependency>
没有Maven(注意:下面的所有罐子都被 jersey-拉入 - json
以上。基本功能可能都不需要,但无论如何我都会包括它们。
Without Maven (Note: all the jars below are pulled in by jersey-json
above. All might not be required for basic functionality, but I would include them anyway)
您可能已经有一些,因为它们是泽西岛罐子。所以请忽略这些。
You may already have some, as they are Jersey jars. So just ignore those.
这是一个地方你可以搜索所有的罐子
Here's a place You can search for all the jars
这篇关于杰克逊不穿球衣的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!