I am new to using the Jersey framework and developing a Web-Service. I am using Weblogic v 10 as the app server for an existing project and trying to start off using a simple HelloWorld sample.
Unfortunately at run time I get a java.lang.NoClassDefFoundError on com/sun/开发者_如何转开发jersey/core/reflection/ReflectionHelper at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig I have tried using multiple versions of the Jersey (.jar files version 1.1.4.1 and 1.1.5.1 and 1.3) but the result is the same. I am building and running this using Java 1.5
The .jar file containing the HelloWorld class is properly loaded into my deployment WEB-INF\classes folder. As for the web.xml file it only contains the servlet-class setting for the Jersey which is found but then invokes the WebComponent class to perform initialization and when that module attempts to createResourceConfig the error is received. The classpath has been checked and appears correct.
Any insight would be appreciated.
You've got more than one version of com/sun/jersey/core/reflection/ReflectionHelper in the web app classpath.
That's what causes a NoClassDefFoundError
Note: this is not the same as a ClassNotFoundException.
Can you search the classpath and all libs to see where the multiple ReflectionHelper classes are found?
I suspect you still have all the -
I have tried using multiple versions of the Jersey .jar files (1.1.4.1 and 1.1.5.1 and 1.3)
- versions lying around. Keep only one - and remove the exploded class as well.
精彩评论