1 Reply Latest reply on Dec 30, 2014 8:43 AM by edilmar

    rich:fileUpload 4.5.1 problem with Glassfish 3.1.2.2 + javax.faces.jar 2.1.29

    edilmar

      Hi,

       

      My environment is: NetBeans 8.0.1 + Glassfish 3.1.2.2 + JSF 2.1.29 + Richfaces 4.5.1 (it was 4.3.7) + CDI/Weld 1.1.8 + Apache DeltaSpike 1.2.1 + JPA 2 + Hibernate 4.2.7 + RDBMS Firebird 2.5.2 + JasperReports 5.5.

       

      Today I tried to upgrade to Richfaces 4.5.1. Many components worked fine, but rich:fileUpload not.

      I know there is an issue about IE9 and about Servlet 3.0 in New in RichFaces 4.5: fileUpload - HTML5 and Servlet 3,

      but also there is an explanation in http://docs.jboss.org/richfaces/latest_4_5_X/Developer_Guide/en-US/html_single/ saying that it works fine with JSF 2.1.28 (or higher).

      Below are the exceptions arised:

       

      Advertência: couldn't parse request parts

      org.richfaces.exception.FileUploadException: couldn't parse request parts

          at org.richfaces.renderkit.FileUploadRendererBase.initializeUploadedFiles(FileUploadRendererBase.java:105)

          at org.richfaces.renderkit.FileUploadRendererBase.doDecode(FileUploadRendererBase.java:140)

          at org.richfaces.renderkit.RendererBase.decode(RendererBase.java:81)

          at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)

          at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1183)

          at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:534)

          at org.richfaces.context.MetaComponentProcessingVisitCallback.visit(MetaComponentProcessingVisitCallback.java:73)

          at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:103)

          at org.richfaces.context.ExtendedExecuteVisitContext.invokeVisitCallback(ExtendedExecuteVisitContext.java:55)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1652)

          at org.richfaces.component.UIDataAdaptor$DataVisitorForVisitTree.process(UIDataAdaptor.java:206)

          at org.ajax4jsf.model.SequenceDataModel.walk(SequenceDataModel.java:66)

          at org.richfaces.component.UIDataAdaptor.walk(UIDataAdaptor.java:816)

          at org.richfaces.component.UIDataAdaptor.visitDataChildren(UIDataAdaptor.java:1289)

          at org.richfaces.component.UIDataTableBase.visitDataChildren(UIDataTableBase.java:375)

          at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1367)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)

          at javax.faces.component.UIForm.visitTree(UIForm.java:371)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)

          at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:383)

          at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:257)

          at org.richfaces.context.ExtendedPartialViewContext.processPartial(ExtendedPartialViewContext.java:263)

          at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:923)

          at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

          at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

          at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

          at util.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:50)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

          at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

          at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

          at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)

          at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)

          at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)

          at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)

          at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

          at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

          at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

          at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

          at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

          at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

          at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

          at java.lang.Thread.run(Thread.java:745)

      Caused by: java.lang.IllegalStateException: PWC4016: Request.getParts is called without multipart configuration.  Either add a @MultipartConfig to the servlet, or a multipart-config element to web.xml

          at org.apache.catalina.connector.Request.checkMultipartConfiguration(Request.java:4077)

          at org.apache.catalina.connector.Request.getParts(Request.java:4084)

          at org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1116)

          at org.richfaces.renderkit.FileUploadRendererBase.initializeUploadedFiles(FileUploadRendererBase.java:84)

          ... 58 more

       

      Grave: org.richfaces.exception.FileUploadException: couldn't parse request parts

          at org.richfaces.renderkit.FileUploadRendererBase.initializeUploadedFiles(FileUploadRendererBase.java:105)

          at org.richfaces.renderkit.FileUploadRendererBase.doDecode(FileUploadRendererBase.java:140)

          at org.richfaces.renderkit.RendererBase.decode(RendererBase.java:81)

          at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)

          at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1183)

          at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:534)

          at org.richfaces.context.MetaComponentProcessingVisitCallback.visit(MetaComponentProcessingVisitCallback.java:73)

          at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:103)

          at org.richfaces.context.ExtendedExecuteVisitContext.invokeVisitCallback(ExtendedExecuteVisitContext.java:55)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1652)

          at org.richfaces.component.UIDataAdaptor$DataVisitorForVisitTree.process(UIDataAdaptor.java:206)

          at org.ajax4jsf.model.SequenceDataModel.walk(SequenceDataModel.java:66)

          at org.richfaces.component.UIDataAdaptor.walk(UIDataAdaptor.java:816)

          at org.richfaces.component.UIDataAdaptor.visitDataChildren(UIDataAdaptor.java:1289)

          at org.richfaces.component.UIDataTableBase.visitDataChildren(UIDataTableBase.java:375)

          at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1367)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)

          at javax.faces.component.UIForm.visitTree(UIForm.java:371)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)

          at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:383)

          at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:257)

          at org.richfaces.context.ExtendedPartialViewContext.processPartial(ExtendedPartialViewContext.java:263)

          at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:923)

          at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

          at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

          at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

          at util.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:50)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

          at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

          at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

          at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)

          at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)

          at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)

          at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)

          at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

          at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

          at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

          at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

          at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

          at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

          at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

          at java.lang.Thread.run(Thread.java:745)

      Caused by: java.lang.IllegalStateException: PWC4016: Request.getParts is called without multipart configuration.  Either add a @MultipartConfig to the servlet, or a multipart-config element to web.xml

          at org.apache.catalina.connector.Request.checkMultipartConfiguration(Request.java:4077)

          at org.apache.catalina.connector.Request.getParts(Request.java:4084)

          at org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1116)

          at org.richfaces.renderkit.FileUploadRendererBase.initializeUploadedFiles(FileUploadRendererBase.java:84)

          ... 58 more

        • 1. Re: rich:fileUpload 4.5.1 problem with Glassfish 3.1.2.2 + javax.faces.jar 2.1.29
          edilmar

          After configure web.xml like this, it worked...

           

            <servlet>

              <servlet-name>Faces Servlet</servlet-name>

              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

              <load-on-startup>1</load-on-startup>

              <multipart-config>

                <location>/tmp</location>

                <max-file-size>20848820</max-file-size>

                <max-request-size>418018841</max-request-size>

                <file-size-threshold>1048576</file-size-threshold>

              </multipart-config>

            </servlet>