2 Replies Latest reply on Dec 10, 2003 10:57 AM by Richard Bielak

    Configuration of UIL2 Connection Factory

    Colin Boyan Newbie

      I am using JBoss 3.2.1 with very few changes out of the box. I am trying to connect to a JMS service from a client application so that I can listen for messages that are posted by server side components. The only JMS entry I can see in the JNDI View in the management console is for java:JmsXA - this is not visible outside of the server JVM (right?).

      The jbossmq-service.xml file has a number of mbeans configured for various invocation layers

      The default/deploy/jms/jms-ds.xml file has a connection-factory element that declares the JmsXA ConnectionFactory entry (mapped to java:/XAConnectionFactory) so I guess I need to add another entry for one of the other invocation layers.

      I have scoured the JBoss Admin and Development book but I can't find any mention of the jms-ds.xml config file. Can anyone tell me how to configure a ConnectionFactory (and anything else I need) to connect to the message service from a separate client app?

      Also ... all of the example code I have seen does a lookup for "ConnectionFactory" but I don't find this defined anywhere and can't see it in the JNDI view. Is this from an earlier version of JBoss or am I missing something else?

      Here is the jms-ds.xml file that defines the JmsXA ConnectionFactory.

      <?xml version="1.0" encoding="UTF-8"?>


      <!-- ==================================================================== -->
      <!-- JMS Stuff -->
      <!-- ==================================================================== -->

      <!-- The JMS provider loader -->




      <!-- The server session pool for Message Driven Beans -->

      <depends optional-attribute-name="XidFactory">jboss:service=XidFactory


      <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->




      <adapter-display-name>JMS Adapter</adapter-display-name>

      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>




      Thanks Colin

      ps. I couldn't see any error messages in the boot or server logs either.

        • 1.
          ssui Newbie

          Have you checked
          oil-service.xml file located in the same directory?
          In this file, it defines ConnectionFactory as ConnectionFactoryJNDIRef


          • 2. JMS Factories
            Richard Bielak Newbie

            JMS factories are defined in deploy/jms/uil2-service.xml which defines how to connect to JMS from outside client. The connection factory is called "UIL2ConnectionFactory".

            So to connect JBoss from a client program you have to do something like this:

            context_ = new InitialContext (jndiProps);
            tcf_ = (TopicConnectionFactory) context_.lookup("UIL2ConnectionFactory);

            where the jndi props are:


            Of course, replace "localhost" with the hostname of the JBoss server.