6 Replies Latest reply on Nov 6, 2012 5:40 PM by Tony Herstell

    Two conversations created instead of one with conversation.begin() in @PostConstruct method

    Luca Cavagnoli Newbie

      Before issuing a bug, I'd like someone to try the following, which exposes a weird  behaviour in Weld's conversation management.


      All will work fine if you use this bean/page as they are, but if you move the outputText with id 'convout' inside the form, two conversations will be started instead of one!!! The first conversation will be righfully created when the pages is requested the rist time. But another one will be created when you press the 'Increment' button.


      (I'm experiencing this with JBoss AS 7.1.1.Final, JBoss Developer Studio 5, with a Java EE Web Project)




      public class ConvTest implements Serializable {
          private static final long serialVersionUID = 2866431447137331469L;
          private Conversation conversation;
          private int counter;
          public void postCon() {
              if (conversation.isTransient())
          public void increment() {
          public Conversation getConversation() {
              return conversation;
          public int getCounter() {
              return counter;




      <?xml version="1.0" encoding="UTF-8"?>
      <html xmlns="http://www.w3.org/1999/xhtml"
          <!-- Moving this outputText inside the form causes the side effect -->
          <h:outputText value="#{convTest.conversation}" id="convout"/>
              <h:commandButton value="Increment" action="#{convTest.increment}" />        
          <h:outputText value="#{convTest.counter}" />