Solved

File upload issue using apache

Posted on 2013-01-03
3
4,928 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 34

Accepted Solution

by:
Gary Patterson earned 500 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 34

Expert Comment

by:Gary Patterson
ID: 38742598
Happy to help.

- Gary
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 104
JList custom Cell Renderer refresh 15 56
fibonacci ten numbers 4 38
Which non-HTML GUI front end to use with Java? 3 19
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

813 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now