Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multiple RMI servers in single JVM

843793May 19 2006 — edited May 23 2006
Hi,

I have a RMI server listening to requests from internal network as well as external network. RMI returns the hostname as part of the stub. So to ensure that the subsequent RMI calls work fine I need to ensure that jama.rmi.hostname is set to correct value.

With 2 network IPs on 1 machine (internal & external), one option was to use a domain name as hostname and set it as java.rmi.hostname. Unfortunately, my client is not allowing use of DNS. So the hostname can be set only as an IP address.

Is there some way I can start 2 RMI servers in single JVM. While starting first one I can set hostname as internal IP and then while starting the other one I set hostname as external IP.

Problem is I don't know if such a solution can be setup. I read somewhere that from jdk1.4, System.setProperty("java.rmi.server.hostname", "172.25.17.41"); will set hostname dynamically. So all future requests will use the latest hostname.

Important thing is some way to make sure both networks can connect to my JVM through RMI.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2006
Added on May 19 2006
13 comments
631 views