I have written an rmi server and client. The server is on a machine that has 2 IP addresses, a local one (192.168.0.1) and a public one (195.*.*.*). Now everything works properly if the client points to the local ip. However when I try to point the client to the public ip address (which is what I would like to do), it doesn't "see" the server. The only solution I have found for this is to disable the ethernet card which provides the local ip address.
The following is where I think I am missing something out, (in the server that is)
String hostnameProperty = "java.rmi.server.hostname";
java.util.Properties systemProperties = System.getProperties();
String hostname = systemProperties.getProperty(hostnameProperty);
hostname = java.net.InetAddress.getLocalHost().getHostAddress();
Registry reg = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
Thanks for your help