11 Replies Latest reply on Oct 24, 2001 12:06 PM by lolsson

    javax.transaction.xa.XAException - XAER_OUTSIDE

    lolsson

      I am getting a javax.transaction.xa.XAException in an MDB
      that appends messages to a JMS queue. The MDB acquires
      its queue and queue connection in ejbCreate() and holds
      on to them. In onMessage() it creates a queue session,
      a queue sender, it sends data via the queue sender,
      and it then closes the queue sender and the queue session
      before onMessage() terminates.

      This works most of the time but every now and then
      (when the load is heavy) the call to close the queue
      session leads to a javax.transaction.xa.XAException.

      The error code for the XAException is XAER_OUTSIDE

      The MDB uses container managed transactions.

      What kind of mistakes lead to exceptions such as
      this one?

      I am using JBoss 2.4.3 on Red Hat Linux 6.2.

      Lars

        • 1. Re: javax.transaction.xa.XAException - XAER_OUTSIDE

          You are sending multiple messages through the JMS resource adapter, in a container managed TX MDB, right?
          >
          >
          > session leads to a javax.transaction.xa.XAException.
          > The error code for the XAException is XAER_OUTSIDE
          Hiram, do you know anything about this (the TX stuff in the JMS RA is stolen from your TX stuff in the MDB container)?


          //Peter

          • 2. Re: javax.transaction.xa.XAException - XAER_OUTSIDE
            lolsson

            > You are sending multiple messages through the JMS
            > resource adapter, in a container managed TX MDB,
            > right?

            That is more or less it although I am not sure what
            is meant by "multiple" in this case.

            The MDB in question is a container managed TX MDB.
            In its deployment descriptor the queue connection
            factory and the JMS queue(s) it sends messages to
            are represented by <resource-ref> elements.

            It consumes messages from a JMS queue. In its
            onMessage() it usually sends one message to another
            JMS queue. It may actually send messages to several
            other JMS queues, but it never sends more then one
            message per queue in onMessage().

            Lars


            • 3. Re: javax.transaction.xa.XAException - XAER_OUTSIDE

              >
              > That is more or less it although I am not sure what
              > is meant by "multiple" in this case.

              That you in the same "method call" (onMethod) sends more that one message.
              >
              > It consumes messages from a JMS queue. In its
              > onMessage() it usually sends one message to another
              > JMS queue. It may actually send messages to several
              > other JMS queues, but it never sends more then one
              > message per queue in onMessage().

              Do you know if the exception is when you send to several queues and if so if that works sometime and sometime not.

              //Peter

              • 4. Re: javax.transaction.xa.XAException - XAER_OUTSIDE
                lolsson

                > Do you know if the exception is when you send to
                > several queues and if so if that works sometime and
                > sometime not.

                I have added lots of trace code to my Mdb and it seems
                the exception occurs even if the onMessage() function
                sends only one message to one other JMS queue.

                Btw - I have several Mdbs that run the same code. In
                all of these I trace the org.jboss.jms.ra.JmsSession
                they use. I also see a

                returned object org.jboss.jms.ra.JmsManagedConnection

                in the output.

                Finally the XAException mentions:

                FormatId=257, GlobalId=becks.sto.crt.se//200, BranchQual=]

                How do I figure if

                org.jboss.jms.ra.JmsSession@5738e0

                is associated with

                org.jboss.jms.ra.JmsManagedConnection@328980

                and if this is associated with

                FormatId=257, GlobalId=becks.sto.crt.se//200, BranchQual=]

                ?

                Lars

                • 5. Re: javax.transaction.xa.XAException - XAER_OUTSIDE

                  Thats a good question. The logging should probably be cleaned up.

                  //Peter

                  • 6. Re: javax.transaction.xa.XAException - XAER_OUTSIDE
                    lolsson

                    It would be nice if the org.jboss.jms.ra.JmsSession
                    class had an accessor method that returned a ref
                    to the JmsManagedConnection instance that the
                    JmsSession member variable 'mc' refers to.

                    Lars

                    • 7. Re: javax.transaction.xa.XAException - XAER_OUTSIDE

                      For debugging, or why?

                      //Peter

                      • 8. Re: javax.transaction.xa.XAException - XAER_OUTSIDE
                        lolsson

                        > For debugging, or why?

                        Yes - only for debugging.

                        L

                        • 9. Re: javax.transaction.xa.XAException - XAER_OUTSIDE

                          David Jenks have not backported some bugfixes in the pool/jbosscs stuff that probably was the reason to the behaviour. Could you pleas test the latest CVS Branch_2_4.

                          //Peter

                          • 10. Re: javax.transaction.xa.XAException - XAER_OUTSIDE
                            lolsson

                            > Could you pleas test the latest CVS Branch_2_4.

                            When I try to build this branch I get a compilation
                            error when compiling the file:

                            jboss/src/main/org/jboss/ejb/plugins/MessageDrivenTxInterceptorBMT.java

                            At line 62 in this file there is a call:

                            t1 = tm.disassociateThread();

                            It seems 'tm' is a

                            javax.management.TransactionManager

                            and that this interface does not have a method
                            called disassociateThread().

                            Ideas anyone?

                            Lars


                            • 11. Re: javax.transaction.xa.XAException - XAER_OUTSIDE
                              lolsson

                              > > Could you pleas test the latest CVS Branch_2_4.
                              >
                              >
                              > t1 = tm.disassociateThread();
                              >

                              I simply replaced 'tm' by '(org.jboss.tm.TxManager)tm'
                              in a few places and recompiled. This enabled me to build
                              everything.

                              I have now tested the fix and everything seems fine.

                              Many thanks!
                              My compliments to the JBOSS team for their great work!

                              Lars