java.rmi.server and IP problems

Joined
Aug 20, 2007
Messages
3
Reaction score
0
This concerns a set up of networked servers, which serve local clients and also communicate with each other over RMI. When IPs of this setup was configured over 10.*.*.* addresses, with each machine having a unique IP address, it worked to perfection.

Now, when upgraded to working over the internet, it is failing for the following reason(s). Each server has two IPs, one of the 192.168.nnn.nnn (LOCAL IP) for LAN access and an internet IP (STATIC IP) for linking to other servers. Assume that the RMI calling machine's IP is important.

On the first invocation, the RMI Server send back to the calling machine an IP and port and the next call is made by the calling machine on this given IP and port. As a result:
A. If the java.rmi.server hostname is set to LOCAL IP, after the first call, other servers fail since they are looking for the LOCAL IP returned by the RMI Server. LAN clients work fine.
B. If the java.rmi.server hostname is set to the internet (static) IP, servers communicate well but the clients land up on router, showing same IP (of the router) to the server which finds it impossible to identify the IP of the caller.

Is there SOME way that the stub will continue to use the IP and port given by the program instead of changing to what came from the RMI server?. I have tried every variety of RMIClientSocketFactory and RMIServerSocketFactory, as also mapping to a local port which maps to the RMI Server. All OK only until the first call of a couple of hundred bytes. Then it goes looking for what came from the server with same problems.

Any ideas?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top