Java.Rmi.Connectexception: Connection Refused to Host: 127.0.1.1;

java.rmi.ConnectException: Connection refused to host: 127.0.1.1;

This is item A.1 in the RMI FAQ. You need to either fix your /etc/hosts file or set the java.rmi.server.hostname property at the server.

Rmi connection refused with localhost

It seems to work when I replace the

Runtime.getRuntime().exec("rmiregistry 2020");

by

LocateRegistry.createRegistry(2020);

anyone an idea why? What's the difference?

java.rmi.ConnectException: Connection refused to host: 127.0.0.1

The Answer was very simple, By default, the registry runs on port 1099. To start the registry on a different port, specify the port number on the command line. Do not forget to unset your CLASSPATH environment variable. for more information check this link: Running the Example Programs

** So for fixing this code i must change the port number form 6060 to 1099

notice that: if 1099 is used by other services you have to test 1100, and if 1100 is used too, you have yo use 1101 and so on. :-)

java.rmi.ConnectException: Connection refused to host: 10.0.0.57

No I have not started the Registry.

Stop right there. You're not going to get anywhere until you start the Registry. You can't connect to something that isn't there.

It's strange that you're getting a connection timeout rather than 'connection refused', but there is nothing else here that needs explaining.

Setting java.rmi.server.hostname won't fix this problem. None of the questions you have cited here is a similar issue. They are all connection refusals in the client when executing a remote method. This is a connection refusal in the server when binding to the Registry.



Related Topics



Leave a reply



Submit