0 Replies Latest reply on Sep 11, 2012 5:05 AM by kapfi

    jboss 7 remote client hornetq problem

    kapfi Newbie



      I have the following problem. I want to remotely connect to my jboss server on machine for example. The client is running on another machine. With standalone-full.xml configuration it works just fine.

      This is ok if i want to run my JBoss instance on this one server. But if i want to put my server.ear file onto another machine with a different IP address i need to change the xml configuration by hand which isn't very convenient since i need to put in the IP address dynamically on JBoss start.


      Is the shown configuration the only way to handle remote clients because i cannot find anything relevant for my case in the forums. If I play around with netty-connector etc. i always get a JMSException:

      ERROR Main - javax.jms.JMSException: Failed to create session factory

      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)

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

          at realtf.client.Main.subscribeTopic(Main.java:57)

          at realtf.client.Main.main(Main.java:43)

      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)

          ... 4 more


      As we can see at the bottom of the xml file the outbound socket host address is hardcoded and i tried to use ${jboss.bind.address:} but this doesnt work if u start jboss with -b

      <socket-binding-group name="standard-sockets" default-interface="any" port-offset="${jboss.socket.binding.port-offset:0}">


      <outbound-socket-binding name="server-notification-socket-binding">

                  <remote-destination host="" port="5445"/>





      Any suggestions or a hint how to configure the netty connectors right so i can switch to different machines with my .ear file deploy it to JBoss and start the Boss with -b hostIP or something like this. So i can connect from any machine (not localhost) to my JBoss Topics and Queues.


      My Client jndi.properties file looks like this:






      The jboss-ejb-client.properties:





      remote.connection.default.port = 4447