jboss 7 remote client hornetq problem
kapfi Sep 11, 2012 5:05 AMHi
I have the following problem. I want to remotely connect to my jboss server on machine 10.30.1.200 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:127.0.0.1} but this doesnt work if u start jboss with -b 10.30.1.200
<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="10.30.1.200" port="5445"/>
</outbound-socket-binding>
</socket-binding-group>
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:
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.provider.url=remote\://10.30.1.200\:4447
java.naming.security.principal=root
java.naming.security.credentials=rootpw
The jboss-ejb-client.properties:
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=10.30.1.200
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.port = 4447
cheers
Michael
-
standalone-full.xml 21.4 KB