I am trying to get REST webservices working in my app. I am using jersey with Spring 2.5. The endpoints for the webservices are generated with enunciate 1.9. When I deploy the generated war file with Tomcat and access the REST webservice I get the following exception:
javax.servlet.ServletException: Servlet.init() for servlet jersey threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
java.lang.Thread.run(Thread.java:662)
root cause:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V
com.sun.jersey.impl.container.config.AnnotatedClassScanner.analyzeClassFile(AnnotatedClassScanner.java:267)
com.sun.jersey.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:229)
com.sun.jersey.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:218)
com.sun.jersey.impl.container.config.AnnotatedClassScanner.indexDir(AnnotatedClassScanner.java:210)
com.sun.jersey.impl.container.config.AnnotatedClassScanner.index(AnnotatedClassScanner.java:169)
com.sun.jersey.impl.container.config.AnnotatedClassScanner.scan(AnnotatedClassScanner.java:105)
com.sun.jersey.api.core.ClasspathResourceConfig.init(ClasspathResourceConfig.java:131)
com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:103)
com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:85)
com.sun.jersey.spi.container.servlet.ServletContainer.createResourceConfig(ServletContainer.java:395)
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:194)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
java.lang.Thread.run(Thread.java:662)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
My web.xml
for the REST servlet part looks like this:
<servlet>
<servlet-name>jersey</servlet-name>
<servlet-class>org.codehaus.enunciate.modules.jersey.EnunciateSpringServlet</servlet-class>
<init-param>
<param-name>org.codehaus.enunciate.modules.jersey.config.ServletPath</param-name>
<param-value>/rest</param-value>
</init-param>
Is there something I need to fix here in the configuration, that can fix the issue?