4 Replies Latest reply on May 27, 2003 2:24 PM by Adrian Brock

    How do I turn off the warning You are not getting the semant

    karp-newbie Newbie

      I am using JBoss 3.0.6, JBossMQ, MDBs and SessionBeans.

      When the MDB calls a SessionBean while handling an incoming JMS message I get the following warning:

      WARN [LocalTxConnectionManager$LocalConnectionEventListener] prepare called on a local tx. You are not getting the semantics you expect!

      When the MDB does not make a call to another bean there's no warning.

      If my understanding is correct, the warning is caused by having a mismatch between transaction manager capabilities. So, I have attempted to change the deployment of JBossMQ to using local transaction managers by essentially changing all references in the jms-service.xml file from XA to Local. This did not change the behavior.

      I deploy JMS by only using the JVM invocation layer.

      Here's my MDB deployment descriptor:

      <message-driven>
      <ejb-name>myMDB</ejb-name>
      <ejb-class>classname</ejb-class>
      <message-selector></message-selector>
      <message-driven-destination>
      <destination-type>javax.jms.Queue</destination-type>
      </message-driven-destination>
      <transaction-type>Container</transaction-type>

      <container-transaction>

      <ejb-name>myMDB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>

      The jboss.xml file is:

      <message-driven>
      <ejb-name>myMDB</ejb-name>
      <jndi-name>myMDB</jndi-name>
      <destination-jndi-name> queue/LocalMessages
      </destination-jndi-name>
      <configuration-name>Standard Message Driven Bean</configuration-name>
      <mdb-user>myMDBUser</mdb-user>
      <mdb-passwd>myMDBPasswd</mdb-passwd>
      <xa-connection>false</xa-connection>
      </message-driven>


      My Standard Message Bean Configuration should be straight out of the box for the most part.

      Any suggestions on how to rid myself of the warnings? I do need to keep the MDB deployed as container managed transaction so that the receipt of the message can be rolled back under certain exception cases, leaving the message on the queue to be tried again.

        • 1. Re: How do I turn off the warning You are not getting the se
          Elias Ross Master


          Well, transactions work for me, and it's likely a problem with your configuration.

          You have to (correctly) set up the queue references and connection pool references in ejb-jar.xml before you can get things to work. (Take a look at the JBoss 2.4 documentation.)

          Your ejb-jar.xml :

          <message-driven>
          <ejb-name>Bean</ejb-name>
          <ejb-class></ejb-class>
          <transaction-type>Container</transaction-type>
          <message-driven-destination>
          <destination-type>javax.jms.Queue</destination-type>
          </message-driven-destination>
          <resource-ref>
          <res-ref-name>jms/QCF</res-ref-name>
          <res-type>javax.jms.QueueConnectionFactory</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>
          <resource-ref>
          <res-ref-name>jms/queue/abc</res-ref-name>
          <res-type>javax.jms.Queue</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>

          Your jboss.xml

          <message-driven>
          <ejb-name>Bean</ejb-name> <destination-jndi-name>queue/abc</destination-jndi-name>
          <resource-ref>
          <res-ref-name>jms/QCF</res-ref-name>
          <jndi-name>java:/JmsXA</jndi-name>
          </resource-ref>
          <resource-ref>
          <res-ref-name>jms/queue/abc</res-ref-name>
          <jndi-name>queue/abc</jndi-name>
          </resource-ref>

          You have to look up the connection at:

          java:/comp/env/jms/QCF

          • 2. Re: How do I turn off the warning You are not getting the se
            Adrian Brock Master

            Changing the MDB connection Local only makes
            it worse.
            Now you have two local transactions instead
            of the one (probably your database).

            If you upgrade to the latest versions, it only
            gives this warning once.
            Alternatively use a database with an xa adaptor.

            Regards,
            Adrian

            • 3. Re: How do I turn off the warning You are not getting the se
              karp-newbie Newbie

              So, which component is likely using XA transactions if it is not JMS or the DB? The MDB's container? The Session Bean's container?

              Also, what does the xa-connection element of the jboss.xml file do?

              • 4. Re: How do I turn off the warning You are not getting the se
                Adrian Brock Master

                It is your DB that is not XA.

                The xa-connection tells jboss not to expect
                an XAConnectionFactory, e.g. older
                versions of MQSeries didn't have one.
                JBossMQ does have one.

                Regards,
                Adrian