wood burning stoves 2.0*
The moose likes Servlets and the fly likes uploading a log file to data base by using servlet. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "uploading a log file to data base by using servlet." Watch "uploading a log file to data base by using servlet." New topic
Author

uploading a log file to data base by using servlet.

chinmaya mishra
Greenhorn

Joined: Jun 09, 2007
Posts: 7
test.html


InsertMessage.java



when I am compiling this java file it successfully get compiled. when i m running it in toncat i am getting some exception


like:


exception

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:196)
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:358)
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
InsertMessage.doPost(InsertMessage.java:46)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



can any body help me in this regard?
Nur Mohammad Shahin
Greenhorn

Joined: Jan 07, 2009
Posts: 1
Do you have the 'commons-io.jar' in your class-path?

If you are using 'commons-fileupload.jar' then it is dependent on 'commons-io.jar'.
So, you have to keep the 'commons-io.jar' in your class-path.


Shahin
J radolf
Ranch Hand

Joined: Jan 08, 2009
Posts: 121
Ya most probably the jar files required for the upload are missing from the classpath and lib folder if you are using tomcat
chinmaya mishra
Greenhorn

Joined: Jun 09, 2007
Posts: 7
Nur Mohammad Shahin wrote:Do you have the 'commons-io.jar' in your class-path?

If you are using 'commons-fileupload.jar' then it is dependent on 'commons-io.jar'.
So, you have to keep the 'commons-io.jar' in your class-path.




Thank you very much Shahin.
 
Consider Paul's rocket mass heater.
 
subject: uploading a log file to data base by using servlet.
 
Similar Threads
problem with fileUpload
problem regarding File Uploading on Server.
Submit multipart and form data
Problem with Image display in JSP
using ServletFileUpload , List size is always becoming zero