7 Replies Latest reply: Oct 28, 2013 6:14 AM by Maroof Ahmad RSS

    javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.

    Maroof Ahmad

      Hi,

       

      I am developing a utility for multiple file upload. I am getting some error here. First i want to explain my case.

       

      I am using JDeveloper 11.1.1.7,

       

      InputFile Properties:  maximumFiles="150"    uploadType="auto"

       

      web.xml change:  org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE =5368709120   (For 5GB)

                                      org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY = 5368709120

                                      org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKEN = 3

                                      session time out = 30 minute   

       

      Here when i am uploading upto 5 files its working fine but when i am selecting more than 15 files its always coming below error.

       

      Error Log
        
      
      AdfcExceptionHandler>  ADFc: While handling an exception the application's exception handler threw a new exception.
      javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._restoreView(LifecycleImpl.java:819)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:422)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:207)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:128)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
        at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
        ADFc: While attempting to handle this exception the application's exception handler failed.
      javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._restoreView(LifecycleImpl.java:819)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:422)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:207)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:128)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
        at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
        ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RESTORE_VIEW 1
      javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._restoreView(LifecycleImpl.java:819)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:422)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:207)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:128)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
        at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
      [Application termination requested.  Undeploying application DMSMultipleFileUploadUtility.]
       

       

      Why is session time out error is coming while 15 files(Small files in KBs) is taking 15-20 sec to upload, what configuration required for this error. Take a look Timo Hahn

       

      Thanks and Regards

      Maroof Ahmad

        • 1. Re: javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
          Timo Hahn

          Maroof, you should decrease the org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY parameter to a smaller value as this meas that 5GB of data can be read into memory.

           

          Do you use IE?

          If yes check

          • InputFile component in multiple file upload mode using IE When an InputFile component configured to support multiple file upload is used with IE with Java enabled, the following settings must be set.
            • In the IE security level for the zone, the option "Include local directory path when uploading files to the server" must be enabled.
            • If the InputFile component is in a popup then in the Java Control Panel under Advanced->Java Plug-in, the option "Enable the Next Generation Java-Plugin" must be disabled.

          If not have you tested this with other browsers?

           

          How do you handle the uploaded files?

           

          Timo

          • 2. Re: javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
            Maroof Ahmad

            Hi Timo,

             

            I am using google chrome and fire fox but not tested in IE. I am trying to do in IE now. As per your changes suggestion.

             

            I created a test case how can i upload here?

             

            Maroof

            • 3. Re: javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
              Timo Hahn

              You can't upload any files here. Put it onto some public available file hoster (e.g. dropbox, google, ...) and post the link together with detailed instructions on how to reproduce the problem.

               

              Timo

              • 4. Re: javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
                Maroof Ahmad

                Hi Timo,

                 

                I have tested in IE  9. Here first problem we unable to select multiple files on one browse click, and if i am selecting more than 10 files its hanged.

                 

                Please find a test case from below link.

                 

                Download Sample Application From Here

                 

                After download unzip application and open in JDeveloper 11.1.1.7 for DB use 10g or later . Run below script in HR schema.

                After open project go to DB connection and change host name to localhost.

                 

                for db:

                Use HR Schema and run below script:
                CREATE TABLE "HR"."DOCUMENTS" 
                ( "DOCUMENT_ID" NUMBER NOT NULL ENABLE, "DOCUMENT_NAME" VARCHAR2(50 BYTE), "DOCUMENT_TYPE" VARCHAR2(100 BYTE), 
                "DOCUMENT_FILE" BLOB, )
                -------------------------------------------------------------------------------
                CONSTRAINT "DOCUMENTS_PK" PRIMARY KEY ("DOCUMENT_ID")
                ---------------------------------------------------------------------------------
                and for sequence
                
                CREATE SEQUENCE "HR"."DOCUMENTS_S" MINVALUE 1 MAXVALUE 999999 INCREMENT BY 1 START WITH 81 CACHE 20 NOORDER NOCYCLE ;
                
                


                -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                After opening and and compiling succesfully run

                run  testCase.jspx and try to upload files. for reproduces case upload more than 20 files in single selection.


                I am using manually Create Row because in my real application i am using more than two DB.


                Maroof

                • 6. Re: javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
                  Timo Hahn

                  Maroof, I loaded the sample but have not looked into it.

                  By the way, there is no guarantee i will as I have a job already. There are many other users which are willing to help. Be patient and try to figure out the problem your self in the meanwhile.


                  Timo

                  • 7. Re: javax.faces.application.ViewExpiredException: viewId:/folderUpload.jspx - ADF_FACES-30107:The view state of the page has expired.  Reload the page.
                    Maroof Ahmad

                    Hi All,

                     

                    Finally i resolved my issue   for my case and working fine. Thanks Timo Hahn for kind help .

                    Solution made by below changes.

                     

                    1. You should use valueChangeListener on inputFile for

                    2.Changes in web.xml

                     

                    Changes in web.xml
                    <context-param>
                        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                        <param-value>client</param-value>
                    </context-param>
                    

                     

                     

                    <context-param>
                        <description>If this parameter is true, there will be an automatic check of the modification date of your JSPs, and saved state will be discarded when JSP's change. It will also automatically check if your skinning css files have changed without you having to restart the server. This makes development easier, but adds overhead. For this reason this parameter should be set to false when your application is deployed.</description>
                        <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
                        <param-value>false</param-value>
                      </context-param>
                    

                     

                     

                    <context-param>
                        <description>Whether the 'Generated by...' comment at the bottom of ADF Faces HTML pages should contain version number information.</description>
                        <param-name>oracle.adf.view.rich.versionString.HIDDEN</param-name>
                        <param-value>true</param-value>
                      </context-param>
                    

                     

                     

                    <context-param>
                        <description>Here Values is in bytes for file upload. This is for 5GB</description>
                        <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE</param-name>
                        <param-value>5368709120</param-value>
                      </context-param>
                    
                    <context-param>
                        <description>Here Values is in bytes for file upload. This is for 5GB</description>
                        <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY</param-name>
                        <param-value>5368709120</param-value>
                      </context-param>
                    
                      <context-param>
                        <description>Session Time out solution 3600 here</description>
                        <param-name>org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKEN</param-name>
                        <param-value>4000</param-value>
                      </context-param>
                    

                     

                     

                    <context-param>
                        <description>"all": stores all state in the client in a (potentially large) hidden form field. This matches the default behavior of the JSF reference implementation, and can be useful for developers avoiding any use of HttpSession.</description>
                        <param-name>org.apache.myfaces.trinidad.CLIENT_STATE_METHOD</param-name>
                        <param-value>all</param-value>
                      </context-param>
                    
                    <context-param>
                        <description>The &lt;uploaded-file-max-disk-space&gt; element is used to change the default location uploaded files are stored. This setting directly overrides the web.xml setting org.apache.myfaces.trinidad.UPLOAD_TEMP_DIR. This value can be hardcoded or can be explicitly configured with an EL expression that returns a String object.</description>
                        <param-name>org.apache.myfaces.trinidad.UPLOAD_TEMP_DIR</param-name>
                        <param-value>/tmp/TrinidadUploads/</param-value>
                      </context-param>
                    

                     

                    For detail configuration of trinidad see  APACHE MYFACES TRINIDAD

                    If your are using large size file then you also increase Java heap size other wise you may get Out Bound Memory

                     

                     

                    Maroof