Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.NoClassDefFoundError: javax/servlet/ServletInputStream

843842Jul 6 2009 — edited Jul 6 2009
Hi. I am just learning about web apps and I am using tomcat as my server to run a servlet. However, I get the following error when I try to run a servlet:
root cause

java.lang.NoClassDefFoundError: javax/servlet/ServletInputStream
	org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:310)
	FileUploadCommons.doPost(FileUploadCommons.java:30)
	FileUploadCommons.doGet(FileUploadCommons.java:46)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:404)
	org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:136)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
I tried moving the commons-fileupload jar to the ext folder of jdk in order to get my servlet to compile, and it compiles successfully but when I go to run it I get the above exception. I've googled and found that some recommend to put it in the lib folder of the WEB-INF folder but I don't have a lib within WEB-INF; I have it within the general apache-tomcat directory.
Thanks in advanced!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 3 2009
Added on Jul 6 2009
6 comments
2,431 views