ClientServerLocalhost
From LucidDB Wiki
Client/server connections aren't working (client and server on same machine or remote). What's wrong?
(Typical symptoms are FarragoServerTest failures, Connection Refused to 127.0.0.1 even though you specified a non-loopback address, or JSwat can't talk to the debuggee process, complaining about UnknownHostException or Socket transport error.)
RMI is very sensitive to an incorrectly configured /etc/hosts. If you are running everything on a single machine with a dynamic IP address and are having trouble with loopback connections, make sure your hosts file looks like this:
127.0.0.1 localhost.localdomain localhost myHostName
The configuration above is reported to have problems on some systems; if it doesn't work, try this as a last resort:
127.0.0.1 localhost.localdomain localhost 127.0.0.1 localhost.localdomain
If instead you are configuring a server which is supposed to accept remote connections, it should look like this:
127.0.0.1 localhost w.x.y.z myHostName.myDomain myHostName
Where w.x.y.z is your server's numeric IP address.
After fixing /etc/hosts, be sure to restart the server process before reattempting to connect from a client. If that doesn't help, try rebooting the machine. Also make sure there's no firewall (software or hardware) in the way.