4 Replies Latest reply on Apr 29, 2013 10:00 AM by fran_jo

    HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

    ps_dash

      Looks like I have no good luck with hornetQ. I'm failing in most of the basic configurations of hornetq.

       

      This is another strange problem I'm facing.

       

      When my hornetQ is running as a standalsone server in the same local machine my producer client (simple java application) is able to connect to it, but when I'm trying to connect to a remote machine, where hornetQ is running as a standalone server I get  HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

       

      My client-jndi.properties:

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

      java.naming.provider.url=jnp://10.225.152.87:1199

      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

      JNDI_NAME_Q=/queue/AUALoggerQueue

      JNDI_NAME_Q_CONNECTION_FACTORY=/ConnectionFactory

       

      The very strange thing is evenif java.naming.provider.url is set to jnp://10.225.152.87:1199 my client producer code automatically connect to the local horneq if it up and running.

       

      Remote hornetq jndi configuration:

      <bean name="JNDIServer" class="org.jnp.server.Main">

            <property name="namingInfo">

               <inject bean="Naming"/>

            </property>    

           <property name="port">1199</property>

           <property name="bindAddress">10.225.152.87</property>

           <property name="rmiPort">1198</property>

           <property name="rmiBindAddress">10.225.152.87</property>

      </bean>

       

      Producer code is attached (LogSender.java)