Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Apache FileUpload - java.lang.NoClassDefFoundError: org/apache/commons/io/FileCleaner

Reply
Thread Tools

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

 
 
kebabkongen@hotmail.com
Guest
Posts: n/a
 
      03-15-2006
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.ge tTempFile(DiskFileItem.java:579)
at
org.apache.commons.fileupload.disk.DiskFileItem.ge tOutputStream(DiskFileItem.java:519)
at
org.apache.commons.fileupload.FileUploadBase.parse Request(FileUploadBase.java:369)
at
org.apache.commons.fileupload.servlet.ServletFileU pload.parseRequest(ServletFileUpload.java:116)
at _registrer__controller._jspService(registrer_contr oller.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

 
Reply With Quote
 
 
 
 
James Westby
Guest
Posts: n/a
 
      03-15-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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.ge tTempFile(DiskFileItem.java:579)
> at
> org.apache.commons.fileupload.disk.DiskFileItem.ge tOutputStream(DiskFileItem.java:519)
> at
> org.apache.commons.fileupload.FileUploadBase.parse Request(FileUploadBase.java:369)
> at
> org.apache.commons.fileupload.servlet.ServletFileU pload.parseRequest(ServletFileUpload.java:116)
> at _registrer__controller._jspService(registrer_contr oller.jsp:29)
> ...

[snip]
> 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
>

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


James
 
Reply With Quote
 
 
 
 
kebabkongen@hotmail.com
Guest
Posts: n/a
 
      03-16-2006
Thank you, James!
That did the trick...

-Per Magnus

James Westby skrev:

> (E-Mail Removed) wrote:
> > 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.ge tTempFile(DiskFileItem.java:579)
> > at
> > org.apache.commons.fileupload.disk.DiskFileItem.ge tOutputStream(DiskFileItem.java:519)
> > at
> > org.apache.commons.fileupload.FileUploadBase.parse Request(FileUploadBase.java:369)
> > at
> > org.apache.commons.fileupload.servlet.ServletFileU pload.parseRequest(ServletFileUpload.java:116)
> > at _registrer__controller._jspService(registrer_contr oller.jsp:29)
> > ...

> [snip]
> > 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
> >

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Axis2 - org.apache.axis2.AxisFault: Transaction not active Michael Post Java 5 08-22-2009 09:33 PM
Apache Tomcat5.5 clustering problem with Apache HTTP server 2.2.4 tanmoy.b81 Java 0 02-04-2009 08:46 AM
Problems running Apache FOP: org.apache.fop.fo.FOTreeBuilder fatalError Pablo Java 0 03-28-2007 02:31 PM
org/apache/xpath/objects/XObject incompatible with org/apache/xpath/objects/XNodeSet duduch_1er@hotmail.com XML 4 08-10-2006 01:38 PM
AXIS jars org.apache.axis.wsi.* and org.apache.axis.transport.jms.* unkwb@web.de Java 0 02-23-2005 04:02 PM



Advertisments