0 Replies Latest reply on Jul 8, 2009 1:17 PM by Derk Dukker

    java.lang.IllegalStateException: Please end the HttpSession via Seam.invalidateSession()

    Derk Dukker Novice

      Hi all,
      I use richfaces 3.1.6SR1 and Seam 1.2.1. I can't upgrade because I'm on Oracle AS which doesn't support JSF 1.2 :-(
      The problem is when the session is expired and I click on a link which executes richfaces javascript I sometimes get this error:





      08 Jul 2009 11:58:07,098 ERROR SeamPhaseListener:68 - uncaught exception
      java.lang.IllegalStateException: Please end the HttpSession via Seam.invalidateSession()
              at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:269)
              at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:45)
              at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:860)
              at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:397)
              at com.evermind.server.http.EvermindHttpServletRequest.unprivileged_getSession(EvermindHttpS
      ervletRequest.java:2760)
              at com.evermind.server.http.EvermindHttpServletRequest.getSession(EvermindHttpServletRequest
      .java:2661)
              at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:26
      0)
              at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:129)
              at org.jboss.seam.contexts.ContextAdaptor.getSession(ContextAdaptor.java:42)
              at org.jboss.seam.contexts.Lifecycle.beginRequest(Lifecycle.java:42)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:52)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:228)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
              at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
              at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:62
      1)
              at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatche
      r.java:370)
              at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
      
              at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
              at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
              at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java
      :260)
              at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.
      java:234)
              at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:2
      9)
              at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHa
      ndler.java:879)
              at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
      xecutor.java:303)
              at java.lang.Thread.run(Thread.java:595)
      08 Jul 2009 11:58:07,114 ERROR SeamPhaseListener:75 - swallowing exception
      java.lang.IllegalStateException: Please end the HttpSession via Seam.invalidateSession()
              at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:269)
              at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:45)
              at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:860)
              at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:397)
              at com.evermind.server.http.EvermindHttpServletRequest.unprivileged_getSession(EvermindHttpS
      ervletRequest.java:2760)
              at com.evermind.server.http.EvermindHttpServletRequest.getSession(EvermindHttpServletRequest
      .java:2661)
              at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:26
      0)
              at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:129)
              at org.jboss.seam.contexts.ContextAdaptor.getSession(ContextAdaptor.java:42)
              at org.jboss.seam.contexts.Lifecycle.beginRequest(Lifecycle.java:42)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:52)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:228)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
              at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
              at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:62
      1)
              at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatche
      r.java:370)
              at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
      
              at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
              at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
              at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java
      :260)
              at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.
      java:234)
              at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:2
      9)
              at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHa
      ndler.java:879)
              at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
      xecutor.java:303)
              at java.lang.Thread.run(Thread.java:595)
      08 Jul 2009 11:58:07,130 ERROR SeamPhaseListener:125 - uncaught exception
      java.lang.IllegalStateException: No application context active
              at org.jboss.seam.Component.forName(Component.java:1577)
              at org.jboss.seam.Component.getInstance(Component.java:1627)
              at org.jboss.seam.Component.getInstance(Component.java:1622)
              at org.jboss.seam.Component.getInstance(Component.java:1599)
              at org.jboss.seam.Component.getInstance(Component.java:1594)
              at org.jboss.seam.core.Manager.instance(Manager.java:269)
              at org.jboss.seam.jsf.AbstractSeamPhaseListener.afterRestoreView(AbstractSeamPhaseListener.j
      ava:53)
              at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:95)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:254)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
              at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
              at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:62
      1)
              at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatche
      r.java:370)
              at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
      
              at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
              at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
              at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java
      :260)
              at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.
      java:234)
              at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:2
      9)
              at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHa
      ndler.java:879)
              at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
      xecutor.java:303)
              at java.lang.Thread.run(Thread.java:595)
      08 Jul 2009 11:58:07,130 ERROR SeamPhaseListener:132 - swallowing exception
      java.lang.IllegalStateException: No application context active
              at org.jboss.seam.Component.forName(Component.java:1577)
              at org.jboss.seam.Component.getInstance(Component.java:1627)
              at org.jboss.seam.Component.getInstance(Component.java:1622)
              at org.jboss.seam.Component.getInstance(Component.java:1599)
              at org.jboss.seam.Component.getInstance(Component.java:1594)
              at org.jboss.seam.core.Manager.instance(Manager.java:269)
              at org.jboss.seam.jsf.AbstractSeamPhaseListener.afterRestoreView(AbstractSeamPhaseListener.j
      ava:53)
              at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:95)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:254)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
              at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
              at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:62
      1)
              at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatche
      r.java:370)
              at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
      
              at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
              at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
              at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java
      :260)
              at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.
      java:234)
              at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:2
      9)
              at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHa
      ndler.java:879)
              at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
      xecutor.java:303)
              at java.lang.Thread.run(Thread.java:595)
      08 Jul 2009 11:58:07,130 ERROR ExceptionFilter:67 - uncaught exception
      java.lang.IllegalStateException: Session was invalidated
              at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:391)
              at com.evermind.server.http.EvermindHttpServletRequest.unprivileged_getSession(EvermindHttpS
      ervletRequest.java:2760)
              at com.evermind.server.http.EvermindHttpServletRequest.getSession(EvermindHttpServletRequest
      .java:2661)
              at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:26
      0)
              at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:129)
              at org.ajax4jsf.application.AjaxStateManager.restoreStateFromSession(AjaxStateManager.java:3
      11)
              at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:243)
              at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:49)
              at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:250)
              at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:310)
              at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
              at org.ajax4jsf.application.AjaxViewHandler.restoreView(AjaxViewHandler.java:159)
              at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:64)
              at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:310)
              at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:310)
              at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
              at org.ajax4jsf.application.AjaxViewHandler.restoreView(AjaxViewHandler.java:159)
              at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:177)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
              at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
              at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
              at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
              at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:62
      1)
              at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatche
      r.java:370)
              at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
      
              at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
              at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
              at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java
      :260)
              at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.
      java:234)
              at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:2
      9)
              at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHa
      ndler.java:879)
              at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledE
      xecutor.java:303)
              at java.lang.Thread.run(Thread.java:595)
      



      This results in an internal server error. I need to close all browser and start a new browser session to use the web app again.
      What can be the problem? Also adding an exception in the pages.xml isn't working.


      my pages.xml looks like this:




      <!DOCTYPE pages PUBLIC
                "-//JBoss/Seam Pages Configuration DTD 1.2//EN"
                "http://jboss.com/products/seam/pages-1.2.dtd">
      
      <pages no-conversation-view-id="/index.xhtml"
                       login-view-id="/login.xhtml">
          <page view-id="*">
              <navigation>
                  <rule if-outcome="home">
                      <redirect view-id="/index.xhtml"/>
                  </rule>
              </navigation>
          </page>
          
          <page view-id="/beroepen/lettercombinatie.xhtml"
          no-conversation-view-id="/timeout.xhtml"/>
      
          <exception class="org.jboss.seam.framework.EntityNotFoundException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Record not found</message>
              </redirect>
          </exception>
          
          <exception class="javax.persistence.EntityNotFoundException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Record not found</message>
              </redirect>
          </exception>
          
          <exception class="javax.persistence.EntityExistsException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Duplicate record</message>
              </redirect>
          </exception>
          
          <exception class="javax.persistence.OptimisticLockException">
              <end-conversation/>
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Another user changed the same data, please try again</message>
              </redirect>
          </exception>
          
          <exception class="org.jboss.seam.security.AuthorizationException">
              <redirect view-id="/error.xhtml">
                  <message severity="error">You don't have permission to access this resource</message>
              </redirect>
          </exception>
          
          <exception class="org.jboss.seam.security.NotLoggedInException">
              <redirect view-id="/login.xhtml">
                  <message severity="warn">#{messages['org.jboss.seam.NotLoggedIn']}</message>
              </redirect>
          </exception>
          
          <exception class="javax.faces.application.ViewExpiredException">
              <redirect view-id="/timeout.xhtml">
                  <message severity="warn">Your session has timed out, please try again</message>
              </redirect>
          </exception>
          
          <exception class="org.jboss.seam.ConcurrentRequestTimeoutException" log-level="trace">
            <http-error error-code="503" />
          </exception>
           
          <exception>
              <redirect view-id="/error.xhtml">
                  <message severity="error">Unexpected error, please try again</message>
              </redirect>
          </exception>   
          
          <exception class="org.jboss.seam.conversationTimeout">
              <redirect view-id="../timeout.xhtml">
                  <message severity="warn">Your session has timed out, please try again</message>
              </redirect>
          </exception> 
          
          <exception class="java.lang.IllegalStateException">
              <redirect view-id="../error.xhtml">
                  <message severity="error">java.lang.IllegalStateException: Probaly Your session has timed out, please try again</message>
              </redirect>
          </exception> 
      
          
          <page view-id="/beroepen/index.xhtml">
               <navigation>
                  <rule if-outcome="openBeroepSBC">
                             <redirect view-id="/beroepen/index.xhtml">
                                  <param name="beroep_cd" value="#{SBCTreeBean.selectedBeroep.cdBeroepsnaam}" />
                                  <param name="pollingEnabled" value="#{true}" />
                             </redirect>
                        </rule>
                   </navigation>
          </page>
          
          <page view-id="/opleidingen/index.xhtml">
               <navigation>
                  <rule if-outcome="openOpleidingSOI">
                             <redirect view-id="/opleidingen/index.xhtml">
                                  <param name="opleiding_cd" value="#{SOITreeBean.selectedOpleiding.cdOpleidingsnaam}" />
                                  <param name="pollingEnabled" value="#{true}" />
                             </redirect>
                        </rule>
                   </navigation>
          </page>
          
          
      
          
      </pages>



      My web.xml:




      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
           version="2.4">
      
           <!-- Seam -->
      
           <listener>
                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
           </listener>
           
           <filter>
               <filter-name>Seam Filter</filter-name>
               <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
             </filter>
             <filter-mapping>
               <filter-name>Seam Filter</filter-name>
               <url-pattern>/*</url-pattern>
             </filter-mapping>
           
           
           <servlet>
                <servlet-name>Faces Servlet</servlet-name>
                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                <load-on-startup>1</load-on-startup>
           </servlet>
           <!-- Faces Servlet Mapping -->
           <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>
                <url-pattern>*.seam</url-pattern>
           </servlet-mapping>
           
           <servlet>
                <servlet-name>Seam Remoting</servlet-name>
                <servlet-class>org.jboss.seam.remoting.SeamRemotingServlet</servlet-class>
                <load-on-startup>2</load-on-startup>
           </servlet>
           <servlet-mapping>
                <servlet-name>Seam Remoting</servlet-name>
                <url-pattern>/seam/remoting/*</url-pattern>
           </servlet-mapping>
           
           <servlet>
              <servlet-name>Seam Resource Servlet</servlet-name>
              <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
          </servlet>
          
          <servlet-mapping>
              <servlet-name>Seam Resource Servlet</servlet-name>
              <url-pattern>/seam/resource/*</url-pattern>
          </servlet-mapping>
      
           <context-param>
                <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                <param-value>server</param-value>
           </context-param>
      
           <context-param>
              <param-name>facelets.DEVELOPMENT</param-name>
              <param-value>true</param-value>
          </context-param>
           <context-param>
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
              <param-value>.xhtml</param-value>
          </context-param>
      
           <!-- <listener>
              <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
           </listener>-->
           
           <!-- Plugging the "Blue Sky" skin into the project -->
           <context-param>
              <param-name>org.richfaces.SKIN</param-name>
              <param-value>blueSky</param-value>
           </context-param>
      
           <!-- Making the RichFaces skin spread to standard HTML controls -->
           <context-param>
                 <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                 <param-value>enable</param-value>
           </context-param>
           
           <context-param>
              <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
              <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
          </context-param>
      
           <!-- Defining and mapping the RichFaces filter -->
           <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>Faces Servlet</servlet-name>
              <dispatcher>REQUEST</dispatcher>
              <dispatcher>FORWARD</dispatcher>
              <dispatcher>INCLUDE</dispatcher>        
           </filter-mapping>
           
            <context-param>
                <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
                <param-value>false</param-value>
           </context-param>
      
            <security-constraint> 
              <display-name>Restrict raw XHTML Documents</display-name>
              <web-resource-collection>
                  <web-resource-name>XHTML</web-resource-name>
                  <url-pattern>*.xhtml</url-pattern>
              </web-resource-collection>
              <auth-constraint/>
          </security-constraint>
          
          <welcome-file-list>
              <welcome-file>index.html</welcome-file>
          </welcome-file-list>
          
          <session-config>
                  <session-timeout>1</session-timeout>
           </session-config>
      
      </web-app>



      I know about the A4J.AJAX.onExpired function.
      I overrided the method and added it to my template. This works now and then.


      layout.xhtml looks like this:




      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <f:subview contentType="text/html"
              xmlns="http://www.w3.org/1999/xhtml"
              xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:a4j="http://richfaces.org/a4j"
              xmlns:s="http://jboss.com/products/seam/taglib">
      
           <div class="body">
           <a4j:region>
               <script language="javascript">
                   A4J.AJAX.onExpired = function(loc, expiredMsg){
                       //alert('Uw sessie is verlopen (Layout)! U wordt teruggeleid naar deze pagina: '+loc);
      
                       //return loc;
                       //window.location = "../timeout.seam";
                       return "../timeout.seam";                 
                   }
               </script>
           </a4j:region>
                <ui:insert name="body"/>
           </div>
      
      
      </f:subview>





      I really need to fix this, so all the help is welcome.


      Regards,


      Derk