File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Problem with FileUpload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with FileUpload" Watch "Problem with FileUpload" New topic
Author

Problem with FileUpload

paramesh ande
Greenhorn

Joined: Dec 15, 2005
Posts: 18
Hi,

I am trying to upload a file by using MultipartRequest.For that i included the corresponding jar file (cos.jar) in the classpath. But it is giving the
exceptions as:

java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:222)
at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:109)
at upload.doGet(upload.java:18)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)


But in the same application remaining servlets are working (Which are not using MultipartRequest).
My ApplicationServer is JBoss 4.0.2.

Plz help me in solving this problem.

thanks in advance
paramesh
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Did you set all the necessary lib (servlet-api.jar) into your lib directory ?


[My Blog]
All roads lead to JavaRanch
paramesh ande
Greenhorn

Joined: Dec 15, 2005
Posts: 18
The problem is coming when i added the jar file by using the myeclipse addexternal jars option.Later I removed it there and put the jar file in the WEB-INF/lib folder.Then the problem solved.It is working fine.
Any how Thank you Satou for ur reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with FileUpload
 
Similar Threads
Illegal Argument exception
connection, pool exhausted ???
File uploading problem
FileNotFoundException is thrown when i try to read a file?
problem with tomcat when i am connection with db2 database