K
kebabkongen
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
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