2 Replies Latest reply on Apr 18, 2012 8:34 AM by Aurélio Gimenes

    ViewExpiredException with fileupload

    Aurélio Gimenes Newbie

      Hi, i´m using

       

      JSF 1.2

      RichFaces 3.3.3

      JBoss Seam 2.2.0

       

      after sending a large file that takes on average five minutes, when I run a submit I get this exception and I lose the reference file. how can I solve this problem?

       

       

      WEB.XML

      <context-param>

          <param-name>org.richfaces.SKIN</param-name>

          <param-value>blueSky</param-value>

      </context-param>

      <filter>

          <display-name>RichFaces Filter</display-name>

          <filter-name>richfaces</filter-name>

          <filter-class>org.ajax4jsf.Filter</filter-class>

      </filter>

       

      <filter-mapping>

          <filter-name>richfaces</filter-name>

          <servlet-name>FacesServlet</servlet-name>

          <dispatcher>REQUEST</dispatcher>

          <dispatcher>FORWARD</dispatcher>

          <dispatcher>INCLUDE</dispatcher>

      </filter-mapping>

       

      <security-constraint>

          <web-resource-collection>

              <url-pattern>/f/a4j/*</url-pattern>

          </web-resource-collection>

      </security-constraint>

      <context-param>

         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

         <param-value>server</param-value> <!-- I tried both client and server-->

      </context-param>

      <filter>

          <display-name>RichFaces Filter</display-name>

          <filter-name>richfaces</filter-name>

          <filter-class>org.ajax4jsf.Filter</filter-class>

          <init-param>

              <param-name>createTempFiles</param-name>

              <param-value>true</param-value>

      </init-param>

      <init-param>

              <param-name>maxRequestSize</param-name>

              <param-value>1000000000</param-value>

      </init-param>

      </filter>

       

      JSP

      <rich:fileUpload

          fileUploadListener="#{inscricaoAction.adicionarArquivo}"                           

          onclear="document.getElementById('corpo:formulario:btClearUploadedData').click();"                           

          id="upload" cleanButtonClassDisabled="display:none;"

          maxFilesQuantity="#{inscricaoAction.uploadsAvailableA}"

          immediateUpload="true"

       

          acceptedTypes="" style="width: 350px;"

          allowFlash="true" noDuplicate="true" listHeight="100px"

          uploadControlLabel="Importar" clearControlLabel="Limpar"

          addControlLabel="Selecionar Arquivos" clearAllControlLabel="Limpar Todos"

          cancelEntryControlLabel="Cancelar" stopControlLabel="Parar"                           

          doneLabel="Arquivo importado com sucesso"

          transferErrorLabel="Erro ao importar o arquivo"

          stopEntryControlLabel="parar"

          progressLabel="Importando o Arquivo...">

          <f:facet name="label">

              <ht:outputText value="{_KB}KB from {KB}KB uploaded --- {mm}:{ss}" />   

          </f:facet>

          <a4j:support event="onuploadcomplete"  reRender="info,upload" />

      </rich:fileUpload>

       

      ERROR:

      2012-04-11 16:10:51,435 [http-80-3] ERROR org.ajax4jsf.webapp.BaseXMLFilter - Exception in the filter chain

      javax.servlet.ServletException: viewId:/t/inscricaoman - null MessageFactory

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

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

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

          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:367)

          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

          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:175)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)

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

          at org.jstripe.tomcat.probe.Tomcat55AgentValve.invoke(Tomcat55AgentValve.java:20)

          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:263)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

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

      Caused by: javax.faces.application.ViewExpiredException: viewId:/t/inscricaoman - null MessageFactory

          at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:186)

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

          at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:104)

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

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

          ... 20 more

        • 1. Re: ViewExpiredException with fileupload
          Denis Golovin Master

          Probably it is better to ask this question on Richfaces forum. I'm going to move to richfaces forum.

          • 2. Re: ViewExpiredException with fileupload
            Aurélio Gimenes Newbie

            I tried adding the following configuration in my components.xml


            <component name="org.jboss.seam.core.manager">

                    <property name="conversationTimeout">1800000</property>

                    <property name="concurrentRequestTimeout">1800000</property>

            </component>

             

            and this on my web.xml

             

            <context-param>

                      <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>

                      <param-value>true</param-value>

            </context-param>

             

            but I had no success

            the funny thing is that this problem only happens when accessing the server from an external computer, and also when using an external computer to access the application the progress bar is completed automatically after selecting the file, when i test internally filtering my upload through NetLimiter waiting 20 minuts to upload this problem doest not happens.