0 Replies Latest reply on Jan 30, 2006 5:02 PM by chetan aggarwal

    ConnectionFactory not able to lookup in HAJNDI

    chetan aggarwal Newbie

      Hi,

      I am using jboss 4.0.3 and i am trying to cluster JMS.

      I have the following entries in deploy/jms/hajndi-jms-ds.xml

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

      <connection-factories>

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

      <!-- The JMS provider loader -->

      DefaultJMSProvider

      org.jboss.jms.jndi.JNDIProviderAdapter

      <!-- The combined connection factory -->
      XAConnectionFactory
      <!-- The queue connection factory -->
      XAConnectionFactory
      <!-- The topic factory -->
      XAConnectionFactory
      <!-- Access JMS via HAJNDI -->

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=localhost:1200
      jnp.disableDiscovery=false
      jnp.partitionName=FLT-DEV2-PARTITION
      jnp.discoveryGroup=${jboss.partition.udpGroup:230.0.0.4}
      jnp.discoveryPort=1102
      jnp.discoveryTTL=16
      jnp.discoveryTimeout=5000
      jnp.maxRetries=1



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

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

      org.jboss.jms.asf.StdServerSessionPoolFactory



      <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
      <tx-connection-factory>
      <jndi-name>JmsXA</jndi-name>
      <xa-transaction/>
      <rar-name>jms-ra.rar</rar-name>
      <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
      <max-pool-size>20</max-pool-size>
      <security-domain-and-application>JmsXARealm</security-domain-and-application>
      </tx-connection-factory>

      </connection-factories>


      I have added a topic in deploy-hasingleton\jms\jbossmq-destinations-service.xml as


      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
      <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager



      In setSessionContext method of a stateless bean , i am trying to lookup HAJNDI as:

      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.PROVIDER_URL, "localhost:1200");
      Context haJndiCtx = new InitialContext(p);
      haJndiCtx.lookup("ConnectionFactory");

      But its always throwing NameNotFoundException.

      Am i missing some configuration?

      Please suggest.

      Thanks and Regards,
      Chetan