File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Runtime Servlet Exception: NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Runtime Servlet Exception: NoClassDefFoundError" Watch "Runtime Servlet Exception: NoClassDefFoundError" New topic
Author

Runtime Servlet Exception: NoClassDefFoundError

Sunny Chandra
Greenhorn

Joined: Feb 18, 2008
Posts: 4
Hi,

I have been trying to execute a custome servlet application with overridden doGet() which handles the ServiceException for handling the Web service response from the server side.

When I try to compile the servlet, all is well! But during the runtime, I am slapped with the NoClassDefFoundError; the partial stacktrace is copied below:

java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceException
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
java.lang.Class.getConstructor0(Class.java:2699)
java.lang.Class.newInstance0(Class.java:326)
java.lang.Class.newInstance(Class.java:308)

The point to note here is jaxrpc jar is there in the classpath and visible in the environment variables in Tomcat's library path. Any suggestions?
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

jaxrpc.jar is missing from classpath. Make sure that jaxrpc.jar is in classpath. Are you using axis? the file is bundled with axis distribution.

Alternatively you can put j2ee.jar in classpath.
[ December 15, 2008: Message edited by: sudhir nim ]

[Servlet tutorial] [Servlet 3.0 Cook Book]
Sunny Chandra
Greenhorn

Joined: Feb 18, 2008
Posts: 4
Hi Sudhir - Thank you for the previous post! However, I have mentioned the last point in the post that jaxrpc is in the classpath; which I rightly picked from the Axis lib.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

> The point to note here is jaxrpc jar is there in the classpath
> and visible in the environment variables in Tomcat's library path.

how about putting jaxrpc.jar inside WEB-INF/lib ?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Runtime Servlet Exception: NoClassDefFoundError
 
Similar Threads
NoClassDefFoundError
NoClassDefFoundError
NoClassDefFoundError
NoClassDefFoundError
NoClassDefFoundError