Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Apache Commons File Upload Problem

Reply
Thread Tools

Apache Commons File Upload Problem

 
 
Chase Preuninger
Guest
Posts: n/a
 
      06-14-2008
Why do I get this error when I upload a really big file.

ServletFileUpload upload = new ServletFileUpload(new
DiskFileItemFactory(512, new Fil(Constants.FILES_BUFFER_DIRECTORY)));

....

File uploadedFile = new File(file.getName());
File to = new File(Constants.NOTES_DIRECTORY, id +
uploadedFile.getName());
to.createNewFile();
ReadableByteChannel in = null;
FileChannel out = null;
try
{
out = new FileOutputStream(to).getChannel();
in = Channels.newChannel(file.getInputStream());
out.transferFrom(in, 0, file.getSize());
NotesManager.setNoteReady(id, to.getName(), conn);
}

....


Jun 13, 2008 9:05:06 PM org.apache.catalina.connector.CoyoteAdapter
service
SEVERE: An exception or error occurred in the container during the
request processing
java.lang.ArrayIndexOutOfBoundsException: 8192
at
org.apache.coyote.http11.InternalOutputBuffer.writ e(InternalOutputBuffer.java:
711)
at
org.apache.coyote.http11.InternalOutputBuffer.writ e(InternalOutputBuffer.java:
61
at
org.apache.coyote.http11.InternalOutputBuffer.send Header(InternalOutputBuffer.java:
491)
at
org.apache.coyote.http11.Http11Processor.prepareRe sponse(Http11Processor.java:
1599)
at
org.apache.coyote.http11.Http11Processor.action(Ht tp11Processor.java:
934)
at org.apache.coyote.Response.action(Response.java:18 3)
at org.apache.coyote.Response.sendHeaders(Response.ja va:379)
at
org.apache.catalina.connector.OutputBuffer.doFlush (OutputBuffer.java:
305)
at
org.apache.catalina.connector.OutputBuffer.close(O utputBuffer.java:
273)
at
org.apache.catalina.connector.Response.finishRespo nse(Response.java:
492)
at
org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:
310)
at
org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:
844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.ja va:583)
at org.apache.tomcat.util.net.JIoEndpoint
$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Jun 13, 2008 9:05:06 PM org.apache.coyote.http11.Http11Processor
process
SEVERE: Error finishing response
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
org.apache.coyote.http11.InternalOutputBuffer.writ e(InternalOutputBuffer.java:
680)
at
org.apache.coyote.http11.InternalOutputBuffer.send Status(InternalOutputBuffer.java:
419)
at
org.apache.coyote.http11.Http11Processor.prepareRe sponse(Http11Processor.java:
158
at
org.apache.coyote.http11.Http11Processor.action(Ht tp11Processor.java:
934)
at org.apache.coyote.Response.action(Response.java:18 1)
at
org.apache.coyote.http11.InternalOutputBuffer.endR equest(InternalOutputBuffer.java:
379)
at
org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:
879)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.ja va:583)
at org.apache.tomcat.util.net.JIoEndpoint
$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
 
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 Commons File Upload in Struts Dispatch Action class (returnsfileItems 0) sudpri02@gmail.com Java 1 11-20-2008 01:52 AM
Apache Commons File Upload in Struts .. Please respond ASAP pinik Java 0 10-28-2008 07:23 PM
Apache Commons File Upload in Struts .. Please respond ASAP pinik.smily4u@gmail.com Java 0 10-28-2008 07:11 PM
Apache Commons File Upload in Struts Dispatch Action class (returnsfileItems 0) sudpri02@gmail.com Java 0 10-28-2008 05:01 PM
Apache Commons File Upload Chase Preuninger Java 1 06-06-2008 11:55 PM



Advertisments