Hi,
The most likely error is a resource class of your application is using
an older version of Jersey compared to the Jersey jars you are
including.
The class "com/sun/ws/rest/spi/service/ContextResolver" is a pre 1.0
class, that was later moved to the JAX-RS API as
javax.ws.rs.ext.ContextResolver:
https://jsr311.dev.java.net/nonav/javadoc/javax/ws/rs/ext/ContextResolver.html
What version of Jersey are you using?
Paul.
On Sep 2, 2009, at 2:15 AM, Gurmeet Chawla wrote:
> java.lang.NoClassDefFoundError: com/sun/ws/rest/spi/service/
> ContextResolver at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
> 124) at
> org
> .apache
> .catalina
> .loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:
> 1817) at
> org
> .apache
> .catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:
> 872) at
> org
> .apache
> .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
> 1325) at
> org
> .apache
> .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
> 1204) at
> com
> .sun
> .jersey
> .impl
> .container
> .config
> .AnnotatedClassScanner.getClassForName(AnnotatedClassScanner.java:
> 322) at
> com.sun.jersey.impl.container.config.AnnotatedClassScanner.access
> $200(AnnotatedClassScanner.java:70) at
> com.sun.jersey.impl.container.config.AnnotatedClassScanner
> $AnnotatedClassVisitor.visitEnd(AnnotatedClassScanner.java:380) at
> org.objectweb.asm.ClassReader.accept(Unknown Source) at
> org.objectweb.asm.ClassReader.accept(Unknown Source) at
> com
> .sun
> .jersey
> .impl
> .container
> .config
> .AnnotatedClassScanner.analyzeClassFile(AnnotatedClassScanner.java:
> 267) at
> com
> .sun
> .jersey
> .impl
> .container
> .config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:
> 229) at
> com
> .sun
> .jersey
> .impl
> .container
> .config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:
> 218) at
> com
> .sun
> .jersey
> .impl
> .container
> .config.AnnotatedClassScanner.indexDir(AnnotatedClassScanner.java:
> 210) at
> com
> .sun
> .jersey
> .impl
> .container
> .config.AnnotatedClassScanner.index(AnnotatedClassScanner.java:169)
> at
> com
> .sun
> .jersey
> .impl
> .container
> .config.AnnotatedClassScanner.scan(AnnotatedClassScanner.java:105)
> at
> com
> .sun
> .jersey
> .api.core.ClasspathResourceConfig.init(ClasspathResourceConfig.java:
> 131) at com.sun.jersey.api.core.ClasspathResourceConfig.
> (ClasspathResourceConfig.java:103) at
> com.sun.jersey.api.core.ClasspathResourceConfig.
> (ClasspathResourceConfig.java:85) at
> com
> .sun
> .jersey
> .spi
> .container
> .servlet.ServletContainer.createResourceConfig(ServletContainer.java:
> 395) at
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 194) at
> org
> .apache
> .catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:
> 1161) at
> org
> .apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:
> 806) at
> org
> .apache
> .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
> 129) at
> org
> .apache
> .catalina.core.StandardContextValve.invoke(StandardContextValve.java:
> 175) at
> org
> .apache
> .catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at
> org
> .apache
> .catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
> at
> org
> .apache
> .catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
> 109) at
> org
> .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> 261) at
> org
> .apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 844) at org.apache.coyote.http11.Http11Protocol
> $Http11ConnectionHandler.process(Http11Protocol.java:581) at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
> 447) at java.lang.Thread.run(Thread.java:619) Caused by:
> java.lang.ClassNotFoundException:
> com.sun.ws.rest.spi.service.ContextResolver at
> org
> .apache
> .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
> 1358) at
> org
> .apache
> .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.ja
>
>
> What could be the reason for this error?.
>
> Thanks in advance.
>
> Gurmeet
>