File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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:
subject: Error running JSP
It's not a secret anymore!