commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Kerschbaumer <joerg.kerschbau...@edu.uni-klu.ac.at>
Subject [fileupload] Stream ended unexpectedly
Date Fri, 05 Oct 2007 12:40:45 GMT

------ Weitergeleitete Nachricht
Von: Jörg Kerschbaumer <joerg.kerschbaumer@edu.uni-klu.ac.at>
Datum: Fri, 05 Oct 2007 14:39:48 +0200
An: <user-help@commons.apache.org>
Unterhaltung: [fileupload]  Stream ended unexpectedly
Betreff: [fileupload]  Stream ended unexpectedly


------ Weitergeleitete Nachricht
Von: Jörg Kerschbaumer <joerg.kerschbaumer@edu.uni-klu.ac.at>
Datum: Fri, 05 Oct 2007 14:36:32 +0200
An: <user-info@commons.apache.org>
Unterhaltung: [fileupload]  Problems with Apache Commons FileUpload....
Betreff: [fileupload]  Problems with Apache Commons FileUpload....

Hi,

I´m using commons-fileupload (1.2 with commons-io 1.3.2) running at a
Glassfish 2.0 application-server. In some cases the Fileupload works great,
but sometimes i get the following error:

org.apache.commons.fileupload.FileUploadBase$IOFileUploadException:
Processing of multipart/form-data request failed. Stream ended unexpectedly
        at 
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.jav
a:359)
        at 
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(Servlet
FileUpload.java:126)
        at 
at.kelag.ebt.servlets.AddRevision.processRequest(AddRevision.java:92)
        at at.kelag.ebt.servlets.AddRevision.doPost(AddRevision.java:323)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at 
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFi
lterChain.java:411)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:290)
        at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:271)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:202)
        at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
)
        at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577
)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206
)
        at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
)
        at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577
)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:150)
        at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
)
        at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577
)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
        at 
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(
DefaultProcessorTask.java:637)
        at 
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(Defa
ultProcessorTask.java:568)
        at 
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(Defaul
tProcessorTask.java:813)
        at 
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTas
k(DefaultReadTask.java:339)
        at 
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadT
ask.java:261)
        at 
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadT
ask.java:212)
        at 
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at 
com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadIm
pl.java:116)
Caused by: 
org.apache.commons.fileupload.MultipartStream$MalformedStreamException:
Stream ended unexpectedly
        at 
org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(
MultipartStream.java:964)
        at 
org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(Multipart
Stream.java:887)
        at java.io.InputStream.read(InputStream.java:89)
        at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94)
        at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)
        at 
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.jav
a:354)
        ... 31 more


For my implementation i use the following code:


 DiskFileItemFactory factory = new DiskFileItemFactory();
            // Set factory constraints
            factory.setSizeThreshold(51200);
            File tmp_file = new File("/temp");
            
            factory.setRepository(tmp_file);
            
// Create a new file upload handler
            ServletFileUpload upload = new ServletFileUpload(factory);
            
// Set overall request size constraint
            
         
            upload.setSizeMax(20971520);
            List  items = upload.parseRequest(request);

Can anybody help me please? I have no idea where i can find a solution for
my problem....


Cheers
Joerg 






------ Ende der weitergeleiteten Nachricht




------ Ende der weitergeleiteten Nachricht



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message