私は次の構造を持っています:
someMethod() {
LocateRegistry.createRegistry(port);
Irrelevant wantToBeBound = new Irrelevant();
String rmiAddress = "rmi://myPrefix/someIP:port/serviceName";
Naming.rebind(rmiAddress, wantToBeBound);
}
Irrelevant wantToBeBound が提供されたので、適切に機能するはずです。ただし、呼び出しは次の をスローし、
そのうちの出力は次のとおりです。Naming.rebind()
RemoteException
getMessage()
Connection refused to host: myPrefix; nested exception is:
java.net.ConnectException: Connection refused
どうしたの?。myPrefix の直後のセミコロンは非常に奇妙ですが、それは問題ですか? (ただし、変更はできません。)