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
Explanation of Generic <T Extends Comparable<? Super T>> in Collection.Sort/ Comparable Code
Differencebetween Reader and Inputstream
How to View Jre's Source Code in Eclipse
How to Run MySQL In-Memory for Junit Test Cases
When Using Mokito, Differencebetween the Actual Object and the Mocked Object
Spring - How to Use Multiple Transaction Managers in the Same Application
What Are the Date Formats Available in Simpledateformat Class
Zoom Box for Area Around Mouse Location on Screen
Getting Xml Node Text Value with Java Dom
Create File with Given Size in Java
Problems with Local Variable Scope. How to Solve It
Error 415 Unsupported Media Type: Post Not Reaching Rest If JSON, But It Does If Xml
How to Ignore Certain Elements When Comparing Xml
Get the Week Start and End Date Given a Current Date and Week Start