Java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused
解决方法是在server端的代码中添加一行代码:
System.setProperty("java.rmi.server.hostname",server端的ip);//添加这行代码
LocateRegistry.createRegistry(1099);
RemoteImpl service = new RemoteImpl();
Naming.rebind("RmiServer", service);
