- 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
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