My problem is

I have my rmi server behind the firewall+nat enivironment:
in the server i have

1: public ip:
2.local ip:
3.gateway ip:

i have assigned the public ip to java.rmi.hostname to public ip and registry.
rebind (localip, objectreference).



System.setProperty("java.rmi.server.useLocalHostnameproperty", "local ip");
catch (Exception ex)
System.setSecurityManager(new RMISecurityManager());


registry.rebind("rmi://local ip:3031/server",this);

in the client i make an look up to remote object


String Rmi_Name="rmi://local ip:3031/server";
int port=3031;

Registry registry=LocateRegistry.getRegistry(public ip,port);

RmiInterface r=(RmiInterface) registry.lookup(Rmi_Name);


i get following Exception in Runtime

java.rmi.ConnectIOException: Exception creating connection to:; nested exception is: No route to host: connect

Please help me...

Recommended Answers

All 4 Replies

Use of code tags would be nice

BTW where are you running the client i.e. on which machine, is it same as the one on which the rmiregistry is running or within the same local area network or from the some other comp connected to the internet ???

iam running the client through internet connection (Lan dissconnected)

You will need to open the rmiregistry port in you firewall, Also to overcome NAT you will need learn about Port forwarding.

How is you public IP connected to the Internet, is it via a Router ?
Honestly I am not yet entirely clear about your setup.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.