Vasantha Raj
Vasantha Raj

Reputation: 647

Jackson does not work in jersey

Exception :-

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)

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.

enter image description here

Upvotes: 0

Views: 1390

Answers (1)

Paul Samsotha
Paul Samsotha

Reputation: 208944

NoSuchMethodError often means a mixing of incompatible versions. Take out all the Jackson related jars/dependencies you have and use the below

With Maven

<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-json</artifactId>
    <version>1.17</version>
</dependency>

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)

enter image description here

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

Upvotes: 1

Related Questions