commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Poulton (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (FILEUPLOAD-143) "Stream ended unexpectedly"
Date Mon, 26 Jul 2010 17:20:21 GMT

    [ https://issues.apache.org/jira/browse/FILEUPLOAD-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892373#action_12892373
] 

Jon Poulton edited comment on FILEUPLOAD-143 at 7/26/10 1:19 PM:
-----------------------------------------------------------------

I've been getting a similar error. The stack trace for us, is as follows:

2010-07-19 17:30:14,887 [TP-Processor7] ERROR vyre.publishing.portal.PortalFramework - Could
not render portlet vyre.publishing.PortletInstance_628#46
org.exoplatform.services.portletcontainer.PortletProcessingException:
at org.exoplatform.services.portletcontainer.plugins.pc.PortletApplicationHandler.processPortletException(PortletApplicationHandler.java:395)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletApplicationHandler.process(PortletApplicationHandler.java:333)
at org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper.service(ServletWrapper.java:139)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.dispatch(PortletContainerDispatcher.java:895)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.process(PortletContainerDispatcher.java:818)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.render(PortletContainerDispatcher.java:708)
at org.exoplatform.services.portletcontainer.impl.PortletContainerServiceImpl.render(PortletContainerServiceImpl.java:569)
at vyre.publishing.portal.PortalFramework.render(PortalFramework.java:751)
at vyre.publishing.portal.PortalFramework.renderPortlet(PortalFramework.java:944)
at vyre.publishing.PortletInstance.render(PortletInstance.java:259)
at sun.reflect.GeneratedMethodAccessor405.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at vyre.publishing.PortletInstance$$EnhancerByCGLIB$$4a6f6a50.render(<generated>)
at org.apache.jsp.WEB_002dINF.jsp.pub_005fmodule.portlet.portlet_005frender_jsp._jspService(Unknown
Source)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at vyre.publishing.ContentArea.render(ContentArea.java:352)
at org.apache.jsp.WEB_002dINF.jsp.pub_005fmodule.portlet.content_005farea_005frender_jsp._jspService(Unknown
Source)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at vyre.publishing.taglibs.ContentAreaTag.doStartTag(ContentAreaTag.java:64)
at org.apache.jsp.WEB_002dINF.generated_005ffiles.pub_005fmodule.template.t47_005f23_jsp._jspx_meth_vyre_002dtemplate_005fcontent_002darea_005f0(t47_005f23_jsp.java:356)
at org.apache.jsp.WEB_002dINF.generated_005ffiles.pub_005fmodule.template.t47_005f23_jsp._jspService(t47_005f23_jsp.java:110)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at vyre.publishing.PathFilter.doFilter(PathFilter.java:240)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at vyre.content.search.permissions.ViewPermissionFilter.doFilter(ViewPermissionFilter.java:27)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at vyre.realms.GateKeeper.doFilter(GateKeeper.java:137)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.portlet.PortletException: Request processing failed
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:496)
at org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:453)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.render(PortletMethodCommand.java:62)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.render(BaseCommandUnit.java:66)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletSessionValidationCommand.render(PortletSessionValidationCommand.java:16)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletContentCommand.render(PortletContentCommand.java:28)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletCacheCommand.render(PortletCacheCommand.java:109)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletFilterCommand.render(PortletFilterCommand.java:71)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletSecurityCommand.render(PortletSecurityCommand.java:49)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.render(BaseCommandUnit.java:66)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.execute(ExecutionContext.java:32)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletCommandChain.doRender(PortletCommandChain.java:61)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletApplicationHandler.process(PortletApplicationHandler.java:300)
... 77 more
Caused by: java.lang.RuntimeException: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException:
Processing of multipart/form-data request failed. null
at vyre.util.params.PortletForm.getMap(PortletForm.java:109)
at vyre.util.params.PortletForm.<init>(PortletForm.java:28)
at vyre.util.params.ParameterManager.getParameters(ParameterManager.java:48)
at vyre.portlets.items.templateEdit.ViewController.handleActionRequestInternal(ViewController.java:105)
at vyre.portlets.items.templateEdit.ViewController.handleActionRequestInternal(ViewController.java:99)
at org.springframework.web.portlet.mvc.AbstractController.handleActionRequest(AbstractController.java:196)
at org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter.handleAction(SimpleControllerHandlerAdapter.java:46)
at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:694)
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:480)
at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:462)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.processAction(PortletMethodCommand.java:89)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.processAction(BaseCommandUnit.java:93)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.processAction(BaseCommandUnit.java:93)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletCacheCommand.processAction(PortletCacheCommand.java:288)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletFilterCommand.processAction(PortletFilterCommand.java:108)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletSecurityCommand.processAction(PortletSecurityCommand.java:68)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.processAction(BaseCommandUnit.java:93)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.execute(ExecutionContext.java:32)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletCommandChain.doProcessAction(PortletCommandChain.java:75)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletApplicationHandler.process(PortletApplicationHandler.java:284)
at org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper.service(ServletWrapper.java:139)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.dispatch(PortletContainerDispatcher.java:895)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.process(PortletContainerDispatcher.java:818)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.processAction(PortletContainerDispatcher.java:670)
at org.exoplatform.services.portletcontainer.impl.PortletContainerServiceImpl.processAction(PortletContainerServiceImpl.java:509)
at vyre.publishing.portal.PortalFramework.processAction(PortalFramework.java:684)
at vyre.publishing.portal.PortalFramework.preRenderProcessing(PortalFramework.java:893)
at vyre.publishing.deployment.PageGenerator.prepareForRender(PageGenerator.java:328)
at vyre.publishing.deployment.PageGenerator.prepareForRender(PageGenerator.java:211)
at vyre.publishing.deployment.PageGenerator.prepareForRender(PageGenerator.java:200)
at vyre.publishing.PathFilter.doFilter(PathFilter.java:193)
... 25 more
Caused by: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing
of multipart/form-data request failed. null
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
at org.apache.commons.fileupload.portlet.PortletFileUpload.parseRequest(PortletFileUpload.java:119)
at vyre.util.params.PortletForm.getMap(PortletForm.java:69)
... 74 more
Caused by: java.io.IOException
at org.apache.jk.common.JkInputStream.receive(JkInputStream.java:199)
at org.apache.jk.common.JkInputStream.refillReadBuffer(JkInputStream.java:258)
at org.apache.jk.common.JkInputStream.doRead(JkInputStream.java:177)
at org.apache.coyote.Request.doRead(Request.java:428)
at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977)
at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887)
at java.io.InputStream.read(InputStream.java:85)
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.java:362)
... 76 more

This happens regularly with very large files. 

MultipartStream appears to be causing problems here. The code that throws the Exception is
as follows: 

lines 963 through 1006 in release 1.2.1

{code:title=MultipartStream.java|borderStyle=solid}
       private int makeAvailable() throws IOException {
            if (pos != -1) {
                return 0;
            }

            // Move the data to the beginning of the buffer.
            total += tail - head - pad;
            System.arraycopy(buffer, tail - pad, buffer, 0, pad);

            // Refill buffer with new data.
            head = 0;
            tail = pad;

            for ( ; ; ) {
                int bytesRead = input.read(buffer, tail, bufSize - tail);
                if (bytesRead == -1) {
                    // The last pad amount is left in the buffer.
                    // Boundary can't be in there so signal an error
                    // condition.
                    final String msg = "Stream ended unexpectedly";
                    throw new MalformedStreamException(msg);
                }
                if (notifier != null) {
                    notifier.noteBytesRead(bytesRead);
                }
                tail += bytesRead;

                findSeparator();
                int av = available();

                if (av > 0 || pos != -1) {
                    return av;
                }
            }
        }
{code}

When input.read() is called it returns -1 indicating that there is no more data to be read.
For some reason this is considered to be an error, and an Exception is thrown. 

I've had a look at previous versions of FileUpload, and more or less the same thing has been
done for a while. I was wondering if anyone could explain to me why an Exception is thrown
in this instance?


References

http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/MultipartStream.html
http://java.sun.com/javase/6/docs/api/java/io/InputStream.html




      was (Author: jsp1611):
    I've been getting a similar error. The stack trace for us, is as follows:

2010-07-19 17:30:14,887 [TP-Processor7] ERROR vyre.publishing.portal.PortalFramework - Could
not render portlet vyre.publishing.PortletInstance_628#46
org.exoplatform.services.portletcontainer.PortletProcessingException:
at org.exoplatform.services.portletcontainer.plugins.pc.PortletApplicationHandler.processPortletException(PortletApplicationHandler.java:395)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletApplicationHandler.process(PortletApplicationHandler.java:333)
at org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper.service(ServletWrapper.java:139)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.dispatch(PortletContainerDispatcher.java:895)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.process(PortletContainerDispatcher.java:818)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.render(PortletContainerDispatcher.java:708)
at org.exoplatform.services.portletcontainer.impl.PortletContainerServiceImpl.render(PortletContainerServiceImpl.java:569)
at vyre.publishing.portal.PortalFramework.render(PortalFramework.java:751)
at vyre.publishing.portal.PortalFramework.renderPortlet(PortalFramework.java:944)
at vyre.publishing.PortletInstance.render(PortletInstance.java:259)
at sun.reflect.GeneratedMethodAccessor405.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at vyre.publishing.PortletInstance$$EnhancerByCGLIB$$4a6f6a50.render(<generated>)
at org.apache.jsp.WEB_002dINF.jsp.pub_005fmodule.portlet.portlet_005frender_jsp._jspService(Unknown
Source)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at vyre.publishing.ContentArea.render(ContentArea.java:352)
at org.apache.jsp.WEB_002dINF.jsp.pub_005fmodule.portlet.content_005farea_005frender_jsp._jspService(Unknown
Source)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at vyre.publishing.taglibs.ContentAreaTag.doStartTag(ContentAreaTag.java:64)
at org.apache.jsp.WEB_002dINF.generated_005ffiles.pub_005fmodule.template.t47_005f23_jsp._jspx_meth_vyre_002dtemplate_005fcontent_002darea_005f0(t47_005f23_jsp.java:356)
at org.apache.jsp.WEB_002dINF.generated_005ffiles.pub_005fmodule.template.t47_005f23_jsp._jspService(t47_005f23_jsp.java:110)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at vyre.publishing.PathFilter.doFilter(PathFilter.java:240)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at vyre.content.search.permissions.ViewPermissionFilter.doFilter(ViewPermissionFilter.java:27)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at vyre.realms.GateKeeper.doFilter(GateKeeper.java:137)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.portlet.PortletException: Request processing failed
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:496)
at org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:453)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.render(PortletMethodCommand.java:62)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.render(BaseCommandUnit.java:66)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletSessionValidationCommand.render(PortletSessionValidationCommand.java:16)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletContentCommand.render(PortletContentCommand.java:28)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletCacheCommand.render(PortletCacheCommand.java:109)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletFilterCommand.render(PortletFilterCommand.java:71)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletSecurityCommand.render(PortletSecurityCommand.java:49)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.render(BaseCommandUnit.java:66)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
at org.exoplatform.container.component.ExecutionContext.execute(ExecutionContext.java:32)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletCommandChain.doRender(PortletCommandChain.java:61)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletApplicationHandler.process(PortletApplicationHandler.java:300)
... 77 more
Caused by: java.lang.RuntimeException: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException:
Processing of multipart/form-data request failed. null
at vyre.util.params.PortletForm.getMap(PortletForm.java:109)
at vyre.util.params.PortletForm.<init>(PortletForm.java:28)
at vyre.util.params.ParameterManager.getParameters(ParameterManager.java:48)
at vyre.portlets.items.templateEdit.ViewController.handleActionRequestInternal(ViewController.java:105)
at vyre.portlets.items.templateEdit.ViewController.handleActionRequestInternal(ViewController.java:99)
at org.springframework.web.portlet.mvc.AbstractController.handleActionRequest(AbstractController.java:196)
at org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter.handleAction(SimpleControllerHandlerAdapter.java:46)
at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:694)
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:480)
at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:462)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.processAction(PortletMethodCommand.java:89)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.processAction(BaseCommandUnit.java:93)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.processAction(BaseCommandUnit.java:93)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletCacheCommand.processAction(PortletCacheCommand.java:288)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletFilterCommand.processAction(PortletFilterCommand.java:108)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletSecurityCommand.processAction(PortletSecurityCommand.java:68)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.executeNextUnit(ExecutionContext.java:39)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.processAction(BaseCommandUnit.java:93)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:57)
at org.exoplatform.container.component.ExecutionContext.execute(ExecutionContext.java:32)
at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletCommandChain.doProcessAction(PortletCommandChain.java:75)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletApplicationHandler.process(PortletApplicationHandler.java:284)
at org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper.service(ServletWrapper.java:139)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.dispatch(PortletContainerDispatcher.java:895)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.process(PortletContainerDispatcher.java:818)
at org.exoplatform.services.portletcontainer.plugins.pc.PortletContainerDispatcher.processAction(PortletContainerDispatcher.java:670)
at org.exoplatform.services.portletcontainer.impl.PortletContainerServiceImpl.processAction(PortletContainerServiceImpl.java:509)
at vyre.publishing.portal.PortalFramework.processAction(PortalFramework.java:684)
at vyre.publishing.portal.PortalFramework.preRenderProcessing(PortalFramework.java:893)
at vyre.publishing.deployment.PageGenerator.prepareForRender(PageGenerator.java:328)
at vyre.publishing.deployment.PageGenerator.prepareForRender(PageGenerator.java:211)
at vyre.publishing.deployment.PageGenerator.prepareForRender(PageGenerator.java:200)
at vyre.publishing.PathFilter.doFilter(PathFilter.java:193)
... 25 more
Caused by: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing
of multipart/form-data request failed. null
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
at org.apache.commons.fileupload.portlet.PortletFileUpload.parseRequest(PortletFileUpload.java:119)
at vyre.util.params.PortletForm.getMap(PortletForm.java:69)
... 74 more
Caused by: java.io.IOException
at org.apache.jk.common.JkInputStream.receive(JkInputStream.java:199)
at org.apache.jk.common.JkInputStream.refillReadBuffer(JkInputStream.java:258)
at org.apache.jk.common.JkInputStream.doRead(JkInputStream.java:177)
at org.apache.coyote.Request.doRead(Request.java:428)
at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977)
at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887)
at java.io.InputStream.read(InputStream.java:85)
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.java:362)
... 76 more

This happens regularly with very large files. 

MultipartStream appears to be causing problems here. The code that throws the Exception is
as follows: 

lines 963 through 1006 in release 1.2.1

       private int makeAvailable() throws IOException {
            if (pos != -1) {
                return 0;
            }

            // Move the data to the beginning of the buffer.
            total += tail - head - pad;
            System.arraycopy(buffer, tail - pad, buffer, 0, pad);

            // Refill buffer with new data.
            head = 0;
            tail = pad;

            for ( ; ; ) {
                int bytesRead = input.read(buffer, tail, bufSize - tail);
                if (bytesRead == -1) {
                    // The last pad amount is left in the buffer.
                    // Boundary can't be in there so signal an error
                    // condition.
                    final String msg = "Stream ended unexpectedly";
                    throw new MalformedStreamException(msg);
                }
                if (notifier != null) {
                    notifier.noteBytesRead(bytesRead);
                }
                tail += bytesRead;

                findSeparator();
                int av = available();

                if (av > 0 || pos != -1) {
                    return av;
                }
            }
        }


When input.read() is called it returns -1 indicating that there is no more data to be read.
For some reason this is considered to be an error, and an Exception is thrown. 

I've had a look at previous versions of FileUpload, and more or less the same thing has been
done for a while. I was wondering if anyone could explain to me why an Exception is thrown
in this instance?


References

http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/MultipartStream.html
http://java.sun.com/javase/6/docs/api/java/io/InputStream.html



  
> "Stream ended unexpectedly"
> ---------------------------
>
>                 Key: FILEUPLOAD-143
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-143
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: CentOS 4.4, Jetty running through Red5 (form of Flash Media Server),
code under JSP
>            Reporter: Luke Scott
>            Assignee: Jochen Wiedmann
>
> I setup an upload script under a JSP. I tested it by uploading a file via html form upload
and it worked fine - the file was received.
> But when I tried uploading the file through a flash interface using the FileReference
object I got a 500 error response. Flash's FileReference API was very vague, and I was unable
to reproduce the error under another interface so I could see the error.... But I finnally
did get something back by writing a catch and writing the error to a file. I don't know if
this is accurate or not:
> "Stream ended unexpectedly"
> I do know that the error occurs when this line is ran:
> List items = upload.parseRequest(request);
> And here is some relevant code, but not all of it: (to show that I do have a factory
set):
> DiskFileItemFactory factory = new DiskFileItemFactory();
> factory.setSizeThreshold(524288000);
> ServletFileUpload upload = new ServletFileUpload(factory);
> upload.setSizeMax(524288000);
> List items = upload.parseRequest(request);
> I am fairly sure that flash is doing something that is throwing commons-fileupload off.
But it does work with apache & php...
> The biggest difference in the headers, or at least the initial headers, is flash passes
a "connection: close" header.
> When searching I came up with some vague answers. This page shows some comments at the
bottom by users with similar problems:
> http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002225.html
> One guy posts a solution to fix the problem, but it seems like it is severely out of
date because where it says "return items;" I do not see items declared in the function of
the line he mentions. Plus he mentions line 336, and it's now on 800 something. Tried his
suggestion but instead returned "true" and "false" (tried both ways) but it didn't work...
Also when I tried his catch line ant said it was invalid, so I had to put "Exception e" instead.
You may notice that his post is in all caps (posts after his appear to be for some reason).
I did make sure to use the proper case (i do know of case sensitivity).
> With further reading I read instances where flash did a "test upload" without sending
the file. In other cases I read something about it not sending to blank lines after the header.
Not sure what my current problem is.... I'm sure once the problem is found, it should be fairly
trivial to fix (i hope).
> Even though it may be flash's fault, it works in PHP and other instances... So it should
work here :)
> Thanks in advance,
> -Luke

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message