2 Replies Latest reply on May 19, 2009 6:57 PM by guy.veraghtert

    error page

    guy.veraghtert

      I'm testing JSF 2.0 error handling features on Glassfish V3 prelude in combination with webbeans. I have following setup:


      A simple facelets page with a form and a button. When the button is clicked an action method is invoked, that action method throws a RuntimeException. An error-page is configure in the web.xml


      <error-page>
           <exception-type>java.lang.Exception</exception-type>
           <location>/error.faces</location>
      </error-page>



      The container tries to forward to the specified error page but webbeans throws following exception:



      javax.context.ContextNotActiveException: No active contexts for scope type javax.context.RequestScoped
           at org.jboss.webbeans.ManagerImpl.getContext(ManagerImpl.java:739)
           at org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler.getProxiedInstance(ClientProxyMethodHandler.java:116)
           at org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:96)
           at org.jboss.webbeans.servlet.HttpSessionManager_$$_javassist_0.setSession(HttpSessionManager_$$_javassist_0.java)
           at org.jboss.webbeans.jsf.WebBeansPhaseListener.afterRestoreView(WebBeansPhaseListener.java:119)
           at org.jboss.webbeans.jsf.WebBeansPhaseListener.afterPhase(WebBeansPhaseListener.java:90)




      The behavior I see is that upon the exception, the request is destroyed, i.e. marked as inactive (see stack):



      DependentContext(AbstractContext).setActive(boolean) line: 86     
      DependentContext.setActive(boolean) line: 124     
      ContextLifecycle.endRequest(String, BeanStore) line: 76     
      ServletLifecycle.endRequest(HttpServletRequest) line: 143     
      WebBeansListener.requestDestroyed(ServletRequestEvent) line: 90     
      Listener(ForwardingServletListener).requestDestroyed(ServletRequestEvent) line: 26     
      StandardContextValve.postInvoke(Request, Response) line: 250     
      PESessionLockingStandardPipeline(StandardPipeline).doInvoke(Request, Response, boolean) line: 720




      Later on, when the container tries to forward to the error page, the exception listed above occurs...


      Is this a bug in Webbeans, Glassfish or am I doing something wrong?