Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Apache FileUpload - java.lang.NoClassDefFoundError: org/apache/commons/io/FileCleaner

Thread view: 
kebabkongen@hotmail.com - 15 Mar 2006 18:03 GMT
Hi!
I am trying to use Apache FileUpload to read a file and store it in a
Oracle Database.
I have made a JSP page (page1) witch has a form for submitting the file
to another JSP page (page2) for processing it.
When submitting the form with a file, I get this error:
***
500 Internal Server Error
java.lang.NoClassDefFoundError: org/apache/commons/io/FileCleaner
    at
org.apache.commons.fileupload.disk.DiskFileItem.getTempFile(DiskFileItem.java:579)
    at
org.apache.commons.fileupload.disk.DiskFileItem.getOutputStream(DiskFileItem.java:519)
    at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:369)
    at
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116)
    at _registrer__controller._jspService(registrer_controller.jsp:29)
...
***
This is the code from the JSP prosessing page (page2) that fails:
***
...
 <body>
 <%
 // Check that we have a file upload request
 FileItemFactory factory;
 ServletFileUpload upload;
 int antall = 0;

 boolean isMultipart = FileUpload.isMultipartContent(request);
 if (isMultipart) {
   // Create a factory for disk-based file items
   try {
     factory = new DiskFileItemFactory();

     // Create a new file upload handler
     upload = new ServletFileUpload(factory);

     // Parse the request
    /* The Program fails right here! */
     java.util.List /* FileItem */ items =
upload.parseRequest(request);
....
****
So, the error comes when trying to parse the request containing a text
file.
It seems as if it is complaining about
org/apache/commons/io/FileCleaner which is apparently missing, but
FileUpload project doesn't say anything about this package.

Any ideas what could be wrong?

Regards,
Per Magnus
James Westby - 15 Mar 2006 18:10 GMT
> Hi!
> I am trying to use Apache FileUpload to read a file and store it in a
[quoted text clipped - 15 lines]
>     at _registrer__controller._jspService(registrer_controller.jsp:29)
> ...
[snip]
> So, the error comes when trying to parse the request containing a text
> file.
[quoted text clipped - 6 lines]
> Regards,
> Per Magnus

Have you also got jakarta commons io available to the jsp? This is
probably a dependency

James
kebabkongen@hotmail.com - 16 Mar 2006 10:20 GMT
Thank you, James!
That did the trick... ;-)

-Per Magnus

James Westby skrev:

> > Hi!
> > I am trying to use Apache FileUpload to read a file and store it in a
[quoted text clipped - 31 lines]
>
> James


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.