3 Replies Latest reply on Aug 4, 2005 12:51 PM by Rohan Talip

    XAConnectionFactory not bound error

    reg vito Newbie


      I have jboss-4.0.3RC1 installed on 2 machines. I do a "run -c all"
      to both and get a cluster of nodes going. I deploy an MDB to
      the farm folder in one and it gets distributed to the other node fine.

      I fire up a client to send 10 JMS messages to the MDB queue on
      one of the machines. Some go to the the local machine. Some
      go to the other machine, but an error pops up in the other machine saying
      that XAConnectionFactory is not bound.

      The client has this for its jndi.properties file:


      It looks up the HAJNDI connection factory like so:
      ConnectionFactory ref = (ConnectionFactory)jndiContext.lookup ("XAConnectionFactory");
      Destination queue = (Destination)jndiContext.lookup("queue/B");

      All other configuration files are just as it came when jboss was

      Any help appreciated.


        • 1. Re: XAConnectionFactory not bound error
          reg vito Newbie

          I found the problem.

          The MDB described above can reply to messages whose
          replyTo field is set. To get the connection factory to create
          a connection to that replyTo destination, it does a new InitialContext()
          in the MDB. This worked in non-clustered environments, but
          as I pointed out, not in a JBoss clustered environment.

          One of the MDB responds with that JNDI error because the InitialContext returned
          has no clue about the HAJNDI connection factory. To fix this, of course,
          you need to use the Context set in the MDB's setMessageDrivenContext()

          Question: shouldn't a new InitialContext() from an MDB return
          the same context as the one set on the MDB's setMessageDrivenContext() method?


          • 2. Re: XAConnectionFactory not bound error
            reg vito Newbie

            Forget my last post. I used by mistake jboss 4.0.2 which has a bug
            that causes the problem in my first post.

            Version 4.0.3 RC1 fixes the problem
            of just being able to use new InitialContext
            and not generating the JNDI error...

            [JBAS-1892] - hajndi-jms-ds.xml uses the wrong connection factory binding

            Thanks for looking anyway,

            • 3. Re: XAConnectionFactory not bound error
              Rohan Talip Newbie


              "regvito" wrote:

              [JBAS-1892] - hajndi-jms-ds.xml uses the wrong connection factory binding

              Thanks for posting the follow up Reggie.

              For anyone else that is interested, the JBAS-1892 bug can be found here:

              The fix for the JBAS-1892 bug can be found here:

              I was wondering, what other side effects could result if this change is not made (or JBoss is not upgraded to JBoss 4.0.3 RC1 or higher) ??

              Could the change fix this problem (if indeed it is a problem) :

              Could someone please explain why having the XAConnectionFactory FactoryRef in the global JNDI namespace (i.e. without the leading 'java:/') makes a difference, compared to it being in the local JVM (i.e. with the leading 'java:/')? Or at least point me to a URL?

              (I am not completely new to JBoss, but I still don't understand this)