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

WeldPhaseListener fails to activate conversation context if conversation is not found

    Details

      Description

      It seems that org.jboss.weld.jsf.WeldPhaseListener fails to activate conversation context if a conversation is not found by the supplied conversation id. This problem is potentially related to SEAMCATCH-46,WELD-855.

      JSR-299 6.7.4 Conversation context lifecycle has a requirement that 'If the propagated conversation cannot be restored, the container must associate the request with a new transient conversation and throw an exception of type javax.enterprise.context.NonexistentConversationException from the restore view phase of the JSF lifecycle.'. However, the implementation of org.jboss.weld.jsf.WeldPhaseListener.activateConversations fails to do that if a conversation is not found by the conversation id.

         private void activateConversations(FacesContext facesContext)
         {
            ConversationContext conversationContext = instance().select(HttpConversationContext.class).get();
            String cid = getConversationId(facesContext, conversationContext);
            log.debug(RESUMING_CONVERSATION, cid);
            if (cid != null && conversationContext.getConversation(cid) == null)
            {
               throw new NonexistentConversationException(NO_CONVERSATION_FOUND_TO_RESTORE, cid);
            }
            conversationContext.activate(cid);
         }
      

      Recovering from the exception becomes difficult since the context is not active. Typical symptom is 'java.lang.IllegalStateException: Unable to load current conversations from the associated request, something went badly wrong when associate() was called
      at org.jboss.weld.context.AbstractConversationContext.getCurrentConversation(AbstractConversationContext.java:413)'

        Gliffy Diagrams

          Activity

          Hide
          nickarls Nicklas Karlsson added a comment -

          Hmm. Yes. I think we could get away with just calling conversationContext.activate() before throwing the exception since that is a passthrough to conversationContext.activate(null) which should use a temp BeanStore for the transient conversation.

          Show
          nickarls Nicklas Karlsson added a comment - Hmm. Yes. I think we could get away with just calling conversationContext.activate() before throwing the exception since that is a passthrough to conversationContext.activate(null) which should use a temp BeanStore for the transient conversation.
          Hide
          hyoty Jarkko Hyöty added a comment -

          Still present in 1.1.1-Final.

          Show
          hyoty Jarkko Hyöty added a comment - Still present in 1.1.1-Final.
          Hide
          bleathem Brian Leathem added a comment -

          This seems to be killing the viewAction from Seam Faces, preventing the viewAction component from performing navigations. Can we re-assess the priority of resolving this? Many eyes are looking at the viewAction right now, for possible inclusion in JSF 2.2.

          I have a JSFUnit/Arquillian test in a feature branch of Seam Faces demonstrating this failure. Please let me know if you would like details on running this test (building JSFUnit is required at the moment).

          Show
          bleathem Brian Leathem added a comment - This seems to be killing the viewAction from Seam Faces, preventing the viewAction component from performing navigations. Can we re-assess the priority of resolving this? Many eyes are looking at the viewAction right now, for possible inclusion in JSF 2.2. I have a JSFUnit/Arquillian test in a feature branch of Seam Faces demonstrating this failure. Please let me know if you would like details on running this test (building JSFUnit is required at the moment).
          Hide
          bleathem Brian Leathem added a comment -

          Nevermind, Pete pointed out to me that the issue I am observing is most likely unrelated to this issuse. Apologies for the Jira SPAM

          Show
          bleathem Brian Leathem added a comment - Nevermind, Pete pointed out to me that the issue I am observing is most likely unrelated to this issuse. Apologies for the Jira SPAM
          Hide
          mkouba Martin Kouba added a comment -

          Still present in 1.1.2.Final (JBoss AS7). Also causes CDI TCK test failure in 1.1 branch.

          Show
          mkouba Martin Kouba added a comment - Still present in 1.1.2.Final (JBoss AS7). Also causes CDI TCK test failure in 1.1 branch.

            People

            • Assignee:
              swd847 Stuart Douglas
              Reporter:
              hyoty Jarkko Hyöty
            • Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development