1 Reply Latest reply on Sep 11, 2009 5:39 AM by Tony Herstell

    Session Timeout now not being caught

    Tony Herstell Master

      Used to get me session timeouts by handling this:



           <exception class="javax.faces.application.ViewExpiredException">
                <end-conversation/>
                <redirect view-id="/home.xhtml">
                     <message severity="INFO">
                          #{messages.session_timeout}
                     </message>
                </redirect>
           </exception>



      Got this in new project using latest JBoss 5.1GA and latest seam but get this (and no session timeout):




      15:17:19,796 SEVERE [lifecycle] JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@2995be78]
      15:17:19,859 ERROR [Exceptions] handled and logged exception
      javax.servlet.ServletException: viewId:/home.seam - View /home.seam could not be restored.
           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.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           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:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
           at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)
           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:/home.seam - View /home.seam could not be restored.
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:185)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           ... 40 more



      I do get put back to home page but no session timeout message is displayed.



      From messages.properties:



      #Session Timeout
      session_timeout=Session Timeout due to inactivity.



        • 1. Re: Session Timeout now not being caught
          Tony Herstell Master


          <?xml version="1.0" encoding="UTF-8"?>
          <pages xmlns="http://jboss.com/products/seam/pages"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd"
               no-conversation-view-id="/home.xhtml"
               login-view-id="/pages/user/login.xhtml">
          
               <page view-id="*" scheme="http">
                    <navigation from-action="#{identity.logout}">
                         <redirect view-id="/home.xhtml" />
                    </navigation>
               </page>
               
               <page view-id="/home.xhtml" login-required="false">
                    <description>Home Page</description>
               </page>
               
               <page view-id="/pages/user/registration.xhtml" login-required="false" scheme="https">
                    <description>Registering of new User</description>
               </page>
               
               <page view-id="/pages/user/login.xhtml" login-required="false" scheme="https">
                    <description>Logging in of new User</description>
                    <navigation>
                         <rule if-outcome="loggedIn">
                              <redirect view-id="/home.xhtml" />
                         </rule>
                    </navigation>
               </page>
               
               <exception class="org.jboss.seam.security.NotLoggedInException">
                    <redirect view-id="/home.xhtml">
                         <message severity="ERROR">
                              #{messages.security_permission}
                         </message>
                    </redirect>
               </exception>
          
               <exception class="org.jboss.seam.security.AuthorizationException">
                    <end-conversation/>
                    <redirect view-id="/home.xhtml">
                         <message severity="ERROR">
                              #{messages.security_not_logged_in}
                         </message>
                    </redirect>
               </exception>
          
               <exception class="javax.faces.application.ViewExpiredException">
                    <end-conversation/>
                    <redirect view-id="/home.xhtml">
                         <message severity="INFO">
                              #{messages.session_timeout}
                         </message>
                    </redirect>
               </exception>
               
               <exception>
                    <end-conversation/>
                    <redirect view-id="/home.xhtml">
                         <message severity="WARN">Unexpected Error #{org.jboss.seam.handledException.message}</message>
                    </redirect>
               </exception>
          
          </pages>