3 Replies Latest reply on Sep 20, 2012 9:57 AM by jbertram

    Cannot connect via JMS with remote connection

    venkman

      Hi there,

       

      i have a problem with connecting via JMS to a remote machine.

       

      When (standalone)-client and server runs on the same machine, everything works fine, but when i try to run the JBoss on a VM, i can get a JNDIContext from the Server,i can do a successful lookup, but i cannot establish a connection.

       

      The Client quits with:

       

      Exception in thread "main" javax.jms.JMSException: Failed to create session factory

          at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:605)

          at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:119)

      ...

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

          at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:769)

          at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)

          ... 2 more


       

      and the Server shows the message:

       

      Channel end notification received, closing Channel ID ...

       

      I'm using the Jboss-as.7.1.1 and i'm starting with -b 0.0.0.0 and use the standalone-full.xml.

       

      Browsing in this forum within threads with similar questions hasn't help.

       

      Please help, it's urgent.

       

      VM

        • 1. Re: Cannot connect via JMS with remote connection
          wdfink

          I'm not sure, but I suppose the hornetQ will use a separate connection and this is suppressed by configuration of the VM or a firewall.

          Where do you run the server and client, which OS? is there a firewall active?

          What if you use two real machines?

          • 2. Re: Cannot connect via JMS with remote connection
            venkman

            I'm using the client on a real Win7 64bit OS and the Server on an VBox generated Ubuntu LTS 64bit guest system, both with Java7 64bit, but

             

            after 2 days of configurating, i got it, but i don't understand the "why" to 100%:

             

            When i bind the JBoss to 0.0.0.0 i have to insert the following in standalone-full.xml:

             

            In the connectors of the hornetq-erver in subsystem "messaging":

             

            <connector name="remote-jms">

                 <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                 <param key="host" value="servers own IP-address"/> aka 192.1.....

                 <param key="port" value="5445"/>

            </connector>

             

            and

             

            <connector-ref connector-name="remote-jms"/> to the connectors of the RemoteConnectionFactory.

             

            if i start jboss with "-b serversown-ip-adress" aka 192.1...... it works out of the box.

             

            but why???

             

            Greetings

             

            VM

            • 3. Re: Cannot connect via JMS with remote connection
              jbertram

              Here's why: https://issues.jboss.org/browse/HORNETQ-952.  I fixed this a couple of months ago, and the fix should be in the AS7 nightlies now.