9 Replies Latest reply on Oct 1, 2008 2:24 PM by luxspes

    Nested in Nested Conversation: Conversation vacuum?

      Hi!


      If I:



      1. Begin long-running conversation

      2. Begin first nested conversation

      3. Begin second nested conversation

      4. End second nested conversation

      5. Try to begin third nested conversation: Exception: beginNested() called with no long-running conversation




      Why? Perhaps there is some kind of conversation vacuum between the ending of the second nested conversation and the beginning of the third? why is it unable to see the long-running conversation? (Hint: I am beginning conversations with <begin-conversation nested="true"/> and ending them with <s:button propagation="end"/>, I tried to begin them with <begin-conversation join="true" nested="true"/> but it had no visible effect.


      Here is the stack trace (and log output of log4j.logger.org.jboss.seam.core.Manager) :


      15:49:35,140 INFO  [STDOUT] 15:49:35,140 DEBUG Manager:560 - Beginning long-running conversation
      15:49:35,687 INFO  [STDOUT] 15:49:35,687 DEBUG Manager:333 - Storing conversation state: 15
      15:49:35,765 INFO  [STDOUT] 15:49:35,765 DEBUG Manager:516 - No stored conversation, or concurrent call to the stored conversation
      15:49:35,828 INFO  [STDOUT] 15:49:35,828 DEBUG Manager:341 - Discarding conversation state: 16
      15:49:35,843 INFO  [STDOUT] 15:49:35,843 DEBUG Manager:516 - No stored conversation, or concurrent call to the stored conversation
      15:49:35,859 INFO  [STDOUT] 15:49:35,859 DEBUG Manager:341 - Discarding conversation state: 17
      15:49:35,875 INFO  [STDOUT] 15:49:35,875 DEBUG Manager:516 - No stored conversation, or concurrent call to the stored conversation
      15:49:35,890 INFO  [STDOUT] 15:49:35,890 DEBUG Manager:341 - Discarding conversation state: 18
      15:49:35,906 INFO  [STDOUT] 15:49:35,906 DEBUG Manager:516 - No stored conversation, or concurrent call to the stored conversation
      15:49:35,921 INFO  [STDOUT] 15:49:35,921 DEBUG Manager:341 - Discarding conversation state: 19
      15:49:40,187 INFO  [STDOUT] 15:49:40,187 DEBUG Manager:497 - Restoring conversation with id: 15
      15:49:41,093 INFO  [STDOUT] 15:49:41,078 DEBUG Manager:333 - Storing conversation state: 15
      15:49:42,546 INFO  [STDOUT] 15:49:42,546 DEBUG Manager:497 - Restoring conversation with id: 15
      15:49:42,578 INFO  [STDOUT] 15:49:42,562 DEBUG Manager:574 - Beginning nested conversation
      15:49:44,000 INFO  [STDOUT] 15:49:44,000 DEBUG Manager:333 - Storing conversation state: 20
      15:49:44,093 INFO  [STDOUT] 15:49:44,093 DEBUG Manager:516 - No stored conversation, or concurrent call to the stored conversation
      15:49:44,125 INFO  [STDOUT] 15:49:44,125 DEBUG Manager:341 - Discarding conversation state: 21
      15:49:46,281 INFO  [STDOUT] 15:49:46,281 DEBUG Manager:497 - Restoring conversation with id: 20
      15:49:46,296 INFO  [STDOUT] 15:49:46,296 DEBUG Manager:574 - Beginning nested conversation
      15:49:49,156 INFO  [STDOUT] 15:49:49,156 DEBUG Manager:333 - Storing conversation state: 22
      15:49:52,343 INFO  [STDOUT] 15:49:52,343 DEBUG Manager:497 - Restoring conversation with id: 22
      15:49:52,343 INFO  [STDOUT] 15:49:52,343 DEBUG Manager:596 - Ending long-running conversation
      15:49:52,359 INFO  [STDOUT] 15:49:52,359 ERROR SeamPhaseListener:120 - uncaught exception
      java.lang.IllegalStateException: beginNested() called with no long-running conversation
           at org.jboss.seam.core.Conversation.beginNested(Conversation.java:239)
           at org.jboss.seam.core.Conversation.begin(Conversation.java:264)
           at org.jboss.seam.navigation.ConversationControl.beginOrEndConversation(ConversationControl.java:70)
           at org.jboss.seam.navigation.Page.preRender(Page.java:242)
           at org.jboss.seam.navigation.Pages.preRender(Pages.java:316)
           at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:560)
           at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:471)
           at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:144)
           at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Unknown Source)
      



      Regards,

        • 1. Re: Nested in Nested Conversation: Conversation vacuum?
          pmuir

          Get your debugger out and try to work why you are ending the root conversation, not the nested conversation.

          • 2. Re: Nested in Nested Conversation: Conversation vacuum?

            Hi!



            Pete Muir wrote on Jul 11, 2008 23:29:


            Get your debugger out and try to work why you are ending the root conversation, not the nested conversation.


            That is exactly what I am doing... wouldn't it be nice if you guys printed:


            Ending nested conversation


            or even better:


            Ending nested conversation level #0 inside long running conversation #1

            instead of (as you do now)


            Ending long-running conversation


            in org.jboss.seam.core.Manager.endConversation:


              public void endConversation(boolean beforeRedirect)
               {
                  if ( isLongRunningConversation() )
                  {
                     log.debug("Ending long-running conversation");
                     if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.endConversation");
                     setLongRunningConversation(false);
                     destroyBeforeRedirect = beforeRedirect;
                     endNestedConversations( getCurrentConversationId() );
                     storeConversationToViewRootIfNecessary();
                  }
               }
            



            That would make debugging a lot easier... should I submit a JIRA on that?


            • 3. Re: Nested in Nested Conversation: Conversation vacuum?

              Hi!


              Tried with <begin-conversation nested="true" if="#{conversation.longRunning}"/>  thinking that maybe I am right and there is a conversation vacuum  (this way, a nested conversation is not started unless it first finds a longRunning conversation) it seems it does the trick.


              The problem, I think, was caused because I end the first nested conversation with <s:button propagation="end"/> but that redirects me to page that has <begin-conversation nested="true"/> on its page.xml, and without the <begin-conversation nested="true" if="#{conversation.longRunning}"/> it tries to start another nested conversation immediately (and I do not want to do that, I want to fall back to the first nested conversation, and then, if and only if a particular button is clicked create the third nested conversation).


              This solution works, but it looks somewhat anti-intuitive (IMHO the <begin-conversation nested="true" if="#{conversation.longRunning}"/> should be implicit... don't you agree?)


              Regards,

              • 4. Re: Nested in Nested Conversation: Conversation vacuum?
                admin.admin.email.tld
                Isn't it true that nested conversations must be inside a LRC?  i.e. can you nest a conversation inside a temporary parent conversation?

                According to page 252 of Seam in Action MEAP regarding @Begin(nested="true"):

                "A true value causes the active long-running conversation to be suspended and starts a
                new, nested long-running conversation. The default is to begin a non-nested
                conversation. This attribute is mutually exclusive with join."

                So it seems what Francisco is saying makes sense.  Why must he specify the if condition in the <begin-conversation> tag?  Shouldn't it default to that if condition?
                • 5. Re: Nested in Nested Conversation: Conversation vacuum?
                  pmuir

                  That would make debugging a lot easier... should I submit a JIRA on that?

                  Go for it, include a patch too.

                  • 6. Re: Nested in Nested Conversation: Conversation vacuum?
                    pmuir

                    Ok, I think I can see where the bug is. Can you submit a report in JIRA?

                    • 7. Re: Nested in Nested Conversation: Conversation vacuum?
                      dwsmith75

                      Was a JIRA ever filled for this? or has it been fixed?

                      • 8. Re: Nested in Nested Conversation: Conversation vacuum?

                        Filed it now: JBSEAM-3484

                        • 9. Re: Nested in Nested Conversation: Conversation vacuum?

                          Please, if this is affecting you, vote for it.