RMI lookup works but method invocation not

后端 未结 2 477

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.

    0 讨论(0)
  • 2020-12-22 02:00

    The error message is

    java.rmi.ConnectException: Connection refused to host: <wrong ip of the server>;
    

    I would check you can ping that server and telnet to the service point.

    0 讨论(0)
提交回复
热议问题