I setup a DNS server and it works perfectly.
But the client still connects to the old ip address for port 1098!!
For example, my hostname is serverA.domain.com
The test procedure:
1. I run the server using: ./run.sh -b serverA.domain.com
2. After server starts up. Ip changed. (e.g. from 184.108.40.206 to 220.127.116.11)
3. I use "nslookup -sil serverA.domain.com" on both my server and client to check if the ip is valid. Both shows 18.104.22.168
4. I run EJB client.
5. On client, netstat -n shows the following:
JBoss returns the old IP address to the client not the hostname.
I thought JBoss would bind itself to the hostname only and not the IP address. It seems that it's not.
I'm very frustrated...
Please help me. Thanks a lot.
I found out the problem.
The rmi stub returned from Jboss is initialized and cached when server is started. (in org.jnp.server.Main.java). Therefore whenever my IP changes later on the server doesn't return the correct stub bound to the new IP address but instead returns the old stub.
So I think I have to modify the source code to get around with this problem.