This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

uploading a log file to data base by using servlet.

 
chinmaya mishra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
J radolf
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic