我有以下结构:
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 后面的分号真的很奇怪,有问题吗?(虽然我不能改变它。)