jQuery in Action, 3rd edition
The moose likes JSP and the fly likes Error running JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Error running JSP" Watch "Error running JSP" New topic

Error running JSP

Andrew McLaren
Ranch Hand

Joined: May 27, 2005
Posts: 33
I am attempting to get a little JSP application set up, and I am having a problem. I have a button that executes (right word?) a java file. Or at least, it's supposed to. Instead, I get this error:

javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceException

I understand that in theory that means that my container can't fine that class. But if I look in my WEB-INF/lib folder, there it is, big as life:

To add further confusion, everything works fine if I run this as a straight java application.

So confused...
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

the lib directory is for jar files.
Put the classes under WEB-INF/classes/{package}/{classes}

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Andrew McLaren
Ranch Hand

Joined: May 27, 2005
Posts: 33
That worked, thanks so much for the quick reply. Wierd part is, I didn't put those class files in there, not entirely sure how they got there to start with, but it works now.


I agree. Here's the link: http://aspose.com/file-tools
subject: Error running JSP
jQuery in Action, 3rd edition