This question already has an answer here:
- Java RMI : connection refused 2 answers
Why I continue to receive following error? I tried to fix a problem by following posts on similar issue, however nothing seems to work.
java.rmi.ConnectException: Connection refused to host: 10.0.0.57; nested exception is:
java.net.ConnectException: Operation timed out
at .....
javax.rmi.ssl.SslRMIClientSocketFactory.createSocket(SslRMIClientSocketFactory.java:120)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 5 more
public static void main(String[] args) throws UnknownHostException {
// Bind to registry
System.setProperty(
"javax.net.ssl.keyStore",
"/Users/xxxx/keys/printserver.jks");
System.setProperty("javax.net.ssl.keyStorePassword", "password");
System.setProperty(
"javax.net.ssl.trustStore",
"//Users/xxxx/keys/printserver.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "password");
System.setProperty("javax.net.ssl.debug", "all");
//System.out.println(java.net.InetAddress.getLocalHost());
try {
System.setProperty("java.rmi.server.hostname", "191.234.6.152");
Registry r = LocateRegistry.getRegistry(null, 5099, new SslRMIClientSocketFactory());
r.bind("LoginServer", new LoginServer());
System.out.println("--- Login Server ready ---");
}