5 Replies Latest reply on May 14, 2010 8:48 PM by Raphael Rodrigues

    javax.faces.application.ViewExpiredException could not be restored

    Raphael Rodrigues Newbie

      Hi all,


      My application is working very well in Google Chrome and Mozilla Firefox. But, some browsers (Internet Explorer 6 or higher) happens ViewExpiredException when I logged and clicked in any menu link.


      Anyone have idea about?


      I'm using Tomcat6 , Seam 2.1.2 , Rich-Faces 3.3.0.


      Best Regards,

        • 1. Re: javax.faces.application.ViewExpiredException could not be restored
          Raphael Rodrigues Newbie
            <context-param>
              <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
              <param-value>com.sun.facelets.FaceletViewHandler</param-value>
            </context-param> 
            <!-- unnecessary with richfaces 3.3.1 -->
            <context-param>
                  <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
                  <param-value>true</param-value>
            </context-param> 
            <!-- ViewExpiredException handling END --> 
            <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>server</param-value>
            </context-param>
          

          • 2. Re: javax.faces.application.ViewExpiredException could not be restored
            Raphael Rodrigues Newbie

            Segue StackTrace:


            Exception during request processing: 
            Caused by javax.servlet.ServletException with message: "viewId:/restrict/main.seam - View /restrict/main.seam could not be restored." 
            javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
            org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
            org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:63)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
            org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
            org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
            org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
            org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
            org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
            org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
            org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
            org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            java.lang.Thread.run(Thread.java:619)Caused by javax.faces.application.ViewExpiredException with message: "viewId:/restrict/main.seam - View /restrict/main.seam could not be restored." 
            com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:186)
            com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
            com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:104)
            com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
            javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
            org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
            org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:63)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
            org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
            org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
            org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
            org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
            org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
            org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
            org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
            org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
            org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            java.lang.Thread.run(Thread.java:619)
            

            • 3. Re: javax.faces.application.ViewExpiredException could not be restored
              Raphael Rodrigues Newbie

              I discovered the reason, but it doesn't make sense for me. That behavor happens why my app name has one special character '-' like localhost:8080/PortalEBT-Web.


              When i test app that way : localhost:8080/PortalEBT . The problem doesn't work anymore.


              Anyone knows the reason for this?

              • 4. Re: javax.faces.application.ViewExpiredException could not be restored
                Rodrigo Uchoa Novice

                Raphael,


                This post saved my life. We were having the same problem and no one had a clue to what it might be. Like yours, our project also had a '-' (/sis-web) in the context name. Once we got rid of the '-', everything worked again.



                I was just wondering two things:


                1- How in the hell did you discover this?
                2- Why exactly does this problem occur? Really strange.



                Best regards!



                • 5. Re: javax.faces.application.ViewExpiredException could not be restored
                  Raphael Rodrigues Newbie

                  Hi Rodrigo,


                  Unfortunately i have no idea why that happened. I just changed my context name app and everything works fine...


                  I think that's a problem from IE but i'm not sure about it.


                  If you discover something interesting, please share for us.


                  Regards,