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

    XAConnectionFactory not bound error

    regvito

      Hello,

      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:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=jboss.naming:org.jnp.interfaces
      java.naming.provider.url=localhost:1100
      


      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
      downloaded.

      Any help appreciated.

      Thanks,
      Reggie

        • 1. Re: XAConnectionFactory not bound error
          regvito

          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()
          method.

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

          Thanks,
          Reggie

          • 2. Re: XAConnectionFactory not bound error
            regvito

            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,
            Reggie

            • 3. Re: XAConnectionFactory not bound error

               

              "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:
              http://jira.jboss.com/jira/browse/JBAS-1892?page=all

              The fix for the JBAS-1892 bug can be found here:
              http://anoncvs.forge.jboss.com/viewrep/JBoss/jbosscx/src/etc/example-config/hajndi-jms-ds.xml?r1=1.2&r2=1.3

              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) :
              http://www.jboss.org/index.html?module=bb&op=viewtopic&t=54596

              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)

              Thanks,

              Rohan