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!