• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat + com.oreilly.servlet Problems

 
Tony Kemp
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I keep getting NoClassDefFoundError exception with my servlets when i use the com.oreilly.servlet package to handle uploads. The cos classes cannot find the javax.servlet.* classes, despite the fact that they are all in my CLASSPATH. My CLASSPATH is: .:/usr/lib/java/jre/lib:/usr/local/tomcat/common/lib/servlet.jar:/usr/local/tomcat/common/lib/cos.jar,
and cos.jar is in both /usr/lib/java/jre/lib/ext and in the location specified in my classpath. I have tried each place singly, and that doesn't work either.
Please help!
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have to put the jar file in ur web-inf/classes/lib directory then tomcat will automatically recognise and use it
 
Tony Kemp
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That didn't work
Tomcat can find the com.oreilly.* classes fine, but the com.oreilly.* classes cannot find the javax.servlet.* classes. This is the error message:
java.lang.NoClassDefFoundError: javax/servlet/ServletInputStream
at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:219)
at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:106)
at vlis.Attachment.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
and so on...
 
Tony Kemp
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, I'm using j2sdk1.4.0 and Tomcat 4.1.9 and the latest release of com.oreilly.servlet
 
Tony Kemp
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, after some more fiddling around and reading mailing list archives, I figured out that I need to copy servlet.jar to lib/ext/ and now it all works.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!