-
1. Re: HornetQ Server with dynamic IP-Address
timfox Jul 15, 2011 5:47 AM (in response to freshmaker)If you specify 0.0.0.0 as bind address in the config, it will bind to all available addresses. This is mentioned in the user manual.
-
2. Re: HornetQ Server with dynamic IP-Address
freshmaker Jul 15, 2011 9:03 AM (in response to timfox)I know this section in the manual.
After setting the host to "0.0.0.0" all my connections from a outside client are refused. For example when I am looking up the ContextFactory:
my_connectionFactory = (ConnectionFactory) my_context.lookup("/ConnectionFactory");
-> Java Exception: "Connection refused to host: 0.0.0.0; nested exception is: .....[Connection refused:connect]"
EDIT: The same code runs on the server machine correct. On the clients it runs correct, if I replace all entries "0.0.0.0" in the server config by the real external ip address of the server.
-
3. Re: HornetQ Server with dynamic IP-Address
clebert.suconic Jul 15, 2011 11:40 AM (in response to freshmaker)you are probably having issues on connecting to JNDI. (lookup).
Since you are running standalone, you should also change hornetq-beans.xml
<!-- JNDI server. Disable this if you don't want JNDI -->
<bean name="JNDIServer" class="org.jnp.server.Main">
<property name="namingInfo">
<inject bean="Naming"/>
</property>
<property name="port">${jnp.port:1099}</property>
<property name="bindAddress">${jnp.host:localhost}</property>
<property name="rmiPort">${jnp.rmiPort:1098}</property>
<property name="rmiBindAddress">${jnp.host:localhost}</property>
</bean>
-
4. Re: HornetQ Server with dynamic IP-Address
freshmaker Jul 15, 2011 12:07 PM (in response to clebert.suconic)When I change the JNDI-host to localhost or 0.0.0.0, then the whole server becomes invisible from the outside.
This is the error in the client after changing to localhost/0.0.0.0 at JNDI and to 0.0.0.0 at HornetQ:
In case of localhost at JNDI:
"Could not obtain connection to any of these urls: XXX.YYY.ZZ.WWW:1099" and discovery failed with error: javax.naming.CommnicationException....[recievied timed out]
In case of 0.0.0.0 at JNDI:
Like before: Connection refused
-
5. Re: HornetQ Server with dynamic IP-Address
clebert.suconic Jul 15, 2011 1:37 PM (in response to freshmaker)I just changed this on my local copy and it worked:
<!-- JNDI server. Disable this if you don't want JNDI -->
<bean name="JNDIServer" class="org.jnp.server.Main">
<property name="namingInfo">
<inject bean="Naming"/>
</property>
<property name="port">1099</property>
<property name="bindAddress">0.0.0.0</property>
<property name="rmiPort">1098</property>
<property name="rmiBindAddress">0.0.0.0</property>
</bean>
Also, change all the acceptors.
On the connectors though.. you will have to define an IP. (maybe you should directly instantiate the connection factories).
-
6. Re: HornetQ Server with dynamic IP-Address
freshmaker Jul 19, 2011 3:37 AM (in response to clebert.suconic)I have run more tests today.
Your solution with 0.0.0.0 as address only works if you connect from the same machine.
From other machines in the network I get exceptions:
0.0.0.0 in the JNDI config results in a "connection refused" exception.
0.0.0.0 in the connectors results in a timeout exception.
0.0.0.0 in the acceptors seem to work.
-
7. Re: HornetQ Server with dynamic IP-Address
jaikiran Jul 19, 2011 3:45 AM (in response to freshmaker)abc def wrote:
I have run more tests today.
Your solution with 0.0.0.0 as address only works if you connect from the same machine.
From other machines in the network I get exceptions:
0.0.0.0 in the JNDI config results in a "connection refused" exception.
You haven't yet posted any real complete code which is doing the lookup. If you are doing the lookup by specifying the Context.PROVIDER_URL value as 0.0.0.0, then it's not going to work. The client, during lookup, is expected to specify the IP or the hostname. 0.0.0.0 on the client will not work.
-
8. Re: HornetQ Server with dynamic IP-Address
freshmaker Jul 19, 2011 10:57 AM (in response to freshmaker)To overcome the problems I am using the service of dynDNS now. Works fine.