This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: uploading a log file to data base by using servlet.
 
Similar Threads
Submit multipart and form data
problem with fileUpload
problem regarding File Uploading on Server.
Problem with Image display in JSP
using ServletFileUpload , List size is always becoming zero