Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-2124

Natural conversation ids are broken

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 2.0.0.CR2
    • Fix Version/s: 2.0.1.CR1
    • Component/s: Core
    • Labels:
      None
    • Affects:
      Documentation (Ref Guide, User Guide, etc.)

      Description

      When re-entering an existing conversation that uses a natural conversation id, we currently get a "Conversation id is already in use" exception like the following:

      Caused by: java.lang.IllegalStateException: Conversation id is already in use: PlaceBid:62748261
      at org.jboss.seam.core.Manager.updateCurrentConversationId(Manager.java:90)
      at org.jboss.seam.faces.FacesManager.beforeRedirect(FacesManager.java:73)
      at org.jboss.seam.faces.FacesManager.redirect(FacesManager.java:164)
      at org.jboss.seam.faces.Navigator.redirect(Navigator.java:91)
      at org.jboss.seam.navigation.RedirectNavigationHandler.navigate(RedirectNavigationHandler.java:53)
      at org.jboss.seam.navigation.Rule.execute(Rule.java:100)
      at org.jboss.seam.navigation.Navigation.navigate(Navigation.java:123)
      at org.jboss.seam.navigation.Pages.navigate(Pages.java:134)
      at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:83)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:119)
      at javax.faces.component.UICommand.broadcast(UICommand.java:383)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)

      The workaround for this is to specify the named conversation within the @Begin annotation for the action being called, like so:

      @Begin(join = true, conversation = "PlaceBid")
      public void placeBid() {

      This way, ConversationInterceptor can redirect to the existing named conversation the same way it does a ce.redirect() for standard conversations. However this is less than ideal, as we don't want to introduce yet another annotation attribute here if we can avoid it. The preferred way of configuring this would be in a navigation rule in pages.xml:

      <page view-id="/auction.xhtml">
      <param name="id" value="#

      {auctionDetail.selectedAuctionId}

      "/>

      <navigation from-action="#

      {bidAction.placeBid}

      ">
      <begin-conversation join="true" conversation="PlaceBid"/>
      <redirect view-id="/bid.xhtml"/>
      </navigation>
      </page>

      The problem with this though is that it happens too late - conversation propagation defined in navigation rules like this get processed in ConversationControl.beginOrEndConversation(), after the action method has already been invoked thereby producing the same "Conversation id already in use" exception.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shane.bryzak Shane Bryzak
                  Reporter:
                  shane.bryzak Shane Bryzak
                • Votes:
                  2 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: