Solved

File upload issue using apache

Posted on 2013-01-03
3
5,509 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

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 35

Expert Comment

by:Gary Patterson
ID: 38742598
Happy to help.

- Gary
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

697 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