Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with MultipartRequest on Tomcat

125 views
Skip to first unread message

Robert Ziemba

unread,
May 29, 2001, 8:51:46 PM5/29/01
to
I am having trouble with a set of servlet utility classes written by Jason
Hunter. I am trying the class MultipartRequest to upload a file to a
servlet. I am using TOMCAT on a windows 98 machine and have built the web
application using Ant. I haven't had any trouble with simple servlets using
this setup, but when I try to create a MultipartRequest object I get the
following error...

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
at com.oreilly.servlet.multipart.MultipartParser.(MultipartParser.java:103)
at com.oreilly.servlet.multipart.MultipartParser.(MultipartParser.java:83)
at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:117)
at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:75)
at upload.doPost(upload.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) .....cut
extra messages


This seems strange to me because the servlet jar is in my CLASSPATH and
TOMCAT appears to be using it...

From the tomcat launch script..

Using CLASSPATH:
C:\tomcat\classes;C:\tomcat\lib\ANT.JAR;C:\tomcat\lib\JAXP.JAR;
C:\tomcat\lib\SERVLET.JAR;C:\tomcat\lib\PARSER.JAR;C:\tomcat\lib\WEBSER~1.JA
R;C:\tomcat\lib\JASPER.JAR;C:\jdk1.3;c:\jdk1.3\lib\servlet.jar;c:\jdk1.3\\li
b\tools.jar

Can anyone suggest where I might look for my mistake?

--
Robert Ziemba
rez...@pop.uky.edu

Phil Hanna

unread,
May 29, 2001, 10:27:36 PM5/29/01
to

Where did you put the Jason Hunter classes? If they are in the
extensions directory, and the servlet classes are not, that would
explain it. Also, why do you have multiple instances of servlet.jar
in your classpath?
--
Phil Hanna
Author of JSP: The Complete Reference
http://www.philhanna.com

Robert Ziemba

unread,
May 30, 2001, 9:14:45 AM5/30/01
to
Thank you. Moving the Hunter classes solved the problem. I had actually
moved them before to the WEB-INF/classes directory but I left a copy in the
jre/classes directory. If I understand this correctly the classloader must
have found the latter classes first and used them. I also removed the
multiple references to servlet.jar which was a remnant of trying anything to
get this to work :) .

Thanks again for your help.

--
Robert Ziemba
rez...@pop.uky.edu

"Phil Hanna" <peh...@yahoo.com> wrote in message
news:3b145a2e...@news.ipass.net...

0 new messages