How do I have to configure a RMI environment so that I'm able to use it in a “real” network?

北城余情 提交于 2019-11-30 17:04:36

You need to add an entry to the hosts file of the machines containing an entry of the form

machinename    privateip

e.g.

virtualmachine    192.168.1.16

This will prevent RMI from sending the localhost host name as a 'call me back' address.

To test this approach, run the following code before and after performing the change.

System.out.println(java.net.InetAddress.getLocalHost());

It should output a local address before the changes and a non-local address after the changes.

Using different versions of the JDK on each server could cause this problem.

Use the java -version command to make sure that you are using the same version of the jre.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!