Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-877

"IllegalStateException: Context is already active" when error-page of exception-type com.sun.faces.context.FacesFileNotFoundException

XMLWordPrintable

    • Hide

      1. deploy war attached to this issue

      2. access "http://localhost/jsf-error/x.xhtml" (or any missing *.xhtml)

      3. A 500 error is displayed instead of forwarding to "/notFound.xhtml" as configured in web.xml

      Show
      1. deploy war attached to this issue 2. access "http://localhost/jsf-error/x.xhtml" (or any missing *.xhtml) 3. A 500 error is displayed instead of forwarding to "/notFound.xhtml" as configured in web.xml

      Weld throws an exception of "IllegalStateException: Context is already active" when attempting to access a facelets page that doesn't exist (one that matches the url-pattern for the FacesServlet).

      Attached is a minimal war (contains no class files) which exhibits this error.

      The web application works if the "WEB-INF/beans.xml" file is removed (not a solution for an application using Weld).

      Simplified stack trace is:

      [#|2011-03-31T20:16:28.406+1000|WARNING|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=169;_ThreadName=Thread-2;|org.apache.catalina.core.StandardHostValve@1042d3b: Exception Processing ErrorPage[exceptionType=com.sun.faces.context.FacesFileNotFoundException, location=/notFound.xhtml]
      javax.servlet.ServletException: Context is already active
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:422)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
      ...
      Caused by: java.lang.IllegalStateException: Context is already active
      at org.jboss.weld.context.AbstractConversationContext.activate(AbstractConversationContext.java:301)
      at org.jboss.weld.jsf.WeldPhaseListener.activateConversations(WeldPhaseListener.java:110)
      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)
      ... 27 more

              lincolnthree Lincoln Baxter III (Inactive)
              cory_prowse Cory Prowse (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: