RMI lookup works but method invocation not

后端 未结 2 476

UPDATE:

The problem is, that i\'m using a kind of 2-way connection.

On client side, this works:

String a = this.lobby.getMsg();
         


        
2条回答
  •  隐瞒了意图╮
    2020-12-22 01:55

    You need to look at item A.1 of the RMI FAQ on the RMI home page. The problem here is that the wrong IP address is being embedded into the remote stub. So the lookup works, because you are specifying the target IP address yourself in the client, but when you execute the remote method you are relying on the IP address in the stub, which is wrong. The solution is either to correct your /etc/hosts file or to set the system property java.rmi.server.hostname at the server JVM.

提交回复
热议问题