[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

File upload issue using apache

Posted on 2013-01-03
3
Medium Priority
?
6,600 Views
Last Modified: 2013-01-03
Hi, I am using apache file upload functionality in a servlet (commons_fileupload-1.2.jar). This application was deployed in websphere portal server 7.
It used to work, but now i am getting below error. It is saying space issue but i am not sure where to check that. Please give your suggestions?

DiskFileItemFactory   fileItemFactory = new DiskFileItemFactory();
fileItemFactory.setSizeThreshold(0);
ServletFileUpload uploadHandler = new ServletFileUpload(fileItemFactory);
uploadHandler.setFileSizeMax(15 * 1024 * 1024);
List items = uploadHandler.parseRequest(request);

Open in new window



Throwable occurred: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. No space left on de
vice
        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:359)
        at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
        at com.bcbsfl.oprwf.fileupload.FileUploadServlet.fileUpload(FileUploadServlet.java:167)
        at com.bcbsfl.oprwf.fileupload.FileUploadServlet.doPost(FileUploadServlet.java:110)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:104)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
        at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3935)
        at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
        at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
        at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
Caused by: java.io.IOException: No space left on device
        at java.io.FileOutputStream.writeBytes(Native Method)
        at java.io.FileOutputStream.write(FileOutputStream.java:277)
        at org.apache.commons.io.output.ThresholdingOutputStream.write(ThresholdingOutputStream.java:129)
        at org.apache.commons.fileupload.util.Streams.copy(Streams.java:101)
        at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)
        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:354)
0
Comment
Question by:kcmovies
  • 2
3 Comments
 
LVL 36

Accepted Solution

by:
Gary Patterson earned 2000 total points
ID: 38742199
"No space left on device" usually means that the disk drive (partition) that you are using is full.  Might also get thrown if you are exceeding a disk quota, but I don't know that for sure.

Small files get stored in memory.  Larger files (by default, if the file is over 10K in size) get stored in the system default temp directory:
System.getProperty("java.io.tmpdir")

Open in new window

Will return the temp directory.

- Gary Patterson
0
 

Author Closing Comment

by:kcmovies
ID: 38742553
This helps. tmp directory is full. Thank you very much for help.
0
 
LVL 36

Expert Comment

by:Gary Patterson
ID: 38742598
Happy to help.

- Gary
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question