2 Replies Latest reply on Jan 30, 2012 1:08 PM by Edilmar Alves

    How to redirect the user to expired.html page after conversation expired

    Edilmar Alves Expert

      My environment is: NetBeans7.0, GlassFish3.1, JSF2 and Weld 1.1.0.


      When the user becomes much time in the same page and the conversation time expires, I would like to redirect to expired.html page. I made this config in web.xml:


        <error-page>
          <exception-type>javax.enterprise.context.NonexistentConversationException</exception-type>
          <location>/expired.html</location>
        </error-page>
        <error-page>
          <exception-type>org.jboss.weld.context.NonexistentConversationException</exception-type>
          <location>/expired.html</location>
        </error-page>
        <error-page>
          <exception-type>javax.faces.application.ViewExpiredException</exception-type>
          <location>/expired.html</location>
        </error-page>
      



      No redirection works. The exception returned is:


      GRAVE: org.jboss.weld.context.NonexistentConversationException: WELD-000321 No conversation found to restore for id 1
              at org.jboss.weld.jsf.WeldPhaseListener.activateConversations(WeldPhaseListener.java:108)
              at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:84)
              at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
              at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:113)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
              at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
              at util.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:64)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
              at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
              at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
              at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
              at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
              at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
              at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
              at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
              at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
              at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
              at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
              at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
              at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
              at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
              at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
              at java.lang.Thread.run(Thread.java:662)