1 Reply Latest reply on Mar 3, 2011 10:17 AM by Sergiu Pienar

    Make standalone HornetQ register its objects in JBoss JNDI

    Sergiu Pienar Expert

      Hi,

       

      I need to somehow make a standalone HornetQ server register its objects in JBoss JNDI.

      I have a standalone server that registers its objects in its own JNDI and JBoss complains it can't find any object that HornetQ registered.

       

      I've found this example on JBoss documentation :

       

      <!-- Bind a remote LDAP server -->

      <mbean code="org.jboss.naming.ExternalContext"

             name="jboss.jndi:service=ExternalContext,jndiName=external/ldap/jboss">

          <attribute name="JndiName">external/ldap/jboss</attribute>

          <attribute name="Properties">

              java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory

              java.naming.provider.url=ldap://ldaphost.jboss.org:389/o=jboss.org

              java.naming.security.principal=cn=Directory Manager

              java.naming.security.authentication=simple

              java.naming.security.credentials=secret

          </attribute>

          <attribute name="InitialContext"> javax.naming.ldap.InitialLdapContext </attribute>

          <attribute name="RemoteAccess">true</attribute>

      </mbean>

       

      Can it be adapted to my case?

       

      Thx.

        • 1. Make standalone HornetQ register its objects in JBoss JNDI
          Sergiu Pienar Expert

          I've used this in my jboss-service.xml and I see in my Global JNDI the ConnectionFactory...but I still can't look it up.

           

          <mbean code="org.jboss.naming.ExternalContext"

                 name="jboss.jndi:service=ExternalContext,jndiName=ConnectionFactory">

              <attribute name="JndiName">ConnectionFactory</attribute>

              <attribute name="Properties">

                  java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

                  java.naming.provider.url=jnp://localhost:1099

              </attribute>

              <attribute name="InitialContext">javax.naming.InitialContext </attribute>

              <attribute name="RemoteAccess">true</attribute>

          </mbean>

           

          +- ConnectionFactory (class: javax.naming.Context)
            |   +- comp (class: javax.namingMain.Context)
            |   +- XAConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory)
            |   +- queue (class: org.jnp.interfaces.NamingContext)
            |   |   +- eventQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- projectQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- receptionQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- customClientQueue1 (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- conditionalRuleQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- inactiveClientQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- purgeArchiveQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- publishQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- imageProviderQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- errorQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- DLQ (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- hibernatedClientQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- businessQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- ExpiryQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- smppPublisherQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   |   +- junitQueue (class: org.hornetq.jms.client.HornetQQueue)
            |   +- ConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory)

           

          It is still not good because when I'm doing the lookup I am doing it on the ConnectionFactory (class: javax.naming.Context) and not the ConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory).How can I do it properly?