13 Replies Latest reply on Aug 23, 2006 3:47 PM by raja05

    Exception in Phaselistener ?

    lcoetzee

      Hi,

      I have just done a cvs update of Seam (and myfaces and facelets). I get the following exception quite often:

      12:12:13,696 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
      java.lang.IllegalStateException: No active application scope
       at org.jboss.seam.core.Init.instance(Init.java:86)
       at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:154)
       at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.afterPhase(SeamExtendedManagedPersistencePhaseListener.java:52)
       at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:23)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:44)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      


      My application still seems to work OK, but it is quite disconcerting to see these exceptions flying past. Any ideas of what is causing this ?

      Regards

      Louis


        • 1. Re: Exception in Phaselistener ?
          gavin.king

          Louis, are you still experiencing this problem?

          If so, please submit a test case to JIRA, TIA.

          • 2. Re: Exception in Phaselistener ?
            lcoetzee

            Hi Gavin

            the Jira I openend for http://www.jboss.com/index.html?module=bb&op=viewtopic&t=81115

            also illustrates the various exceptions.

            See jira
            http://jira.jboss.com/jira/browse/JBSEAM-206

            Or should I create a separate Jira ?

            Thanks

            Louis

            • 3. Re: Exception in Phaselistener ?
              lcoetzee

              Hi Gavin,

              I am still strugling with this exception. Upon further investigation I see that the seam booking example also illustrates this behavior. (Can't see that anything really stops working, except that the log file is filled with these exceptions).

              1. Do an account login
              2. Do a find hotels
              3. Select View hotel (Marriott Courtyard)

              I am running with Seam of today, jboss 404cr2 (ejb3 rc6) with recent nightlies of myfaces and tomahawk (with facelets 1.1.4).

              The exception appears in the logfile:

              10:40:27,766 INFO [STDOUT] Hibernate: select hotel0_.id as id244_0_, hotel0_.address as address244_0_, hotel0_.name as name244_0_, hotel0_.state as state244_0_, hotel0_.country as country244_0_, hotel0_.city as city244_0_, hotel0_.zip as zip244_0_ from Hotel hotel0_ where hotel0_.id=?
              10:40:27,769 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
              java.lang.IllegalStateException: No active application scope
               at org.jboss.seam.core.Init.instance(Init.java:86)
               at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:156)
               at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
               at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:23)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
               at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Thread.java:595)
              


              Regards

              Louis

              • 4. Re: Exception in Phaselistener ?
                gavin.king

                I've never seen this one, it certainly does not happen for me in the booking app. I also did not see it happen in the test code you submitted for that JIRA case.

                So you'll have to help me reproduce it.

                • 5. Re: Exception in Phaselistener ?
                  gavin.king

                  BTW, debug, and make sure you don't have two SeamPhaseListeners registered with JSF...

                  • 6. Re: Exception in Phaselistener ?
                    lcoetzee

                    Hmm... how can I see if I have two SeamPhaseListeners ? Surely for the booking demo that I compile here and deploy (for which I also see the exception) that won't be the case.


                    I haven't changed any of those configuration stuff for a long time. Only thing that really changed was the ejb3 rc6 and jboss 404cr2 and the myfaces nighlies.





                    Do you have any suggestions to try and pinpoint it ? I will try to fallback to the older myfaces and facelets as a first attempt.

                    • 7. Re: Exception in Phaselistener ?
                      lcoetzee

                      Painful... seems to be a Myfaces issue. When I rollback to use the 1.1.1 release of myfaces the exception is gone, but when I use the nightlies for 1.1.2 it pops up.

                      Caught between a rock and hardplace. I am forced to use facelets 1.1.4 (certain fixes in there that I need), but 1.1.4 does not play that nicely with myfaces 1.1.1 (the old duplicate id problem), forcing me to upgrade to the newer myfaces !

                      L

                      • 8. Re: Exception in Phaselistener ?
                        lcoetzee

                        Fixed ! I have upgraded to the myfaces 1.1.2 release which seems to have solved the problem !

                        Relief !

                        Later

                        Louis

                        • 9. Re: Exception in Phaselistener ?
                          goeh

                          The problem seems to be back in myfaces 1.1.3! :-(
                          I get exactly the same exception as Louis.
                          So I'm currently staying with 1.1.2 for a while.

                          /Goran

                          • 10. Re: Exception in Phaselistener ?
                            gavin.king

                            This problem occurred due to a workaround in Seam for a bug in MyFaces prior to 1.1.3. The workaround broke Seam as soon as MyFaces fixed the bug. There is now a configuration parameter that allows Seam to work with both releases of MyFaces:

                            org.jboss.seam.core.init.myFacesLifecycleBug=true|false


                            • 11. Re: Exception in Phaselistener ?
                              german.delacruz

                               

                              "gavin.king@jboss.com" wrote:
                              This problem occurred due to a workaround in Seam for a bug in MyFaces prior to 1.1.3. The workaround broke Seam as soon as MyFaces fixed the bug. There is now a configuration parameter that allows Seam to work with both releases of MyFaces:

                              org.jboss.seam.core.init.myFacesLifecycleBug=true|false


                              Thanks you Gavin, it works for me with myfaces 1.1.4-SNAPSHOT, and tomahawk 1.1.5-SNAPSHOT (they are the actual nightly builds in myfaces m2 snapshot repository)

                              • 12. Re: Exception in Phaselistener ?
                                cvirko

                                I am experiencing the same problem with JSF RI from Sun. I performed all required steps as described in reference document. Thanks

                                Tomas

                                • 13. Re: Exception in Phaselistener ?
                                  raja05

                                  I just had this problem but setting myFacesLifecycleBug to be false made the exception to disappear. Browsing through the code indicates that the Lifecycle.endRequest is called during the render response phase if the variable is set to true and lifecycle.endrequest will reset the application context to null