Java RMI : connection refused

Solution 1:

If you're getting that on bind, rebind, or lookup, the Registry isn't running. If you get it doing the remote call, see item A.1 in the RMI FAQ supplied with the Javadoc, and if you're running Linux also check that your /etc/hosts file maps 127.0.0.1 to localhost and your real ip address to your real hostname - this has been a common problem in some Linux distributions.

Solution 2:

I met the same problem. It's silly but just that I forgot to start the RMI registry process.

So, you also need to run RMI Registry process

rmiregistry 

Before you try to rebind(address, obj) with RMI registry.