无法建立RMI连接到远程计算机 [英] Cannot establish RMI connection to remote machine
问题描述
我似乎无法连接使用RMI的2台机器。为了确保有没有什么毛病我的code我复制从维基百科的简单例子( HTTP: //en.wikipedia.org/wiki/Java_remote_method_invocation ),我编辑的code打印出一个简单的int。
I can't seem to connect 2 machines using RMI. To make sure there wasn't something wrong with my code I copied the simple example from wikipedia (http://en.wikipedia.org/wiki/Java_remote_method_invocation) and I edited the code to print out a simple int.
我想给所有的权限,并把所有的防火墙关闭,我仍然得到这个错误:
I tried giving all permissions and turning all the firewalls off and I still get this error:
java.rmi.ConnectException: Connection refused to host 55.229.xx.xxx; nested
exception is:java.net.ConnectException: Connection timed out: connect
我一直在试图做到这一点,在过去3天,我仍似乎无法让过去的基本配置问题。
I've been trying to do this for the past 3 days and I still can't seem to get past basic configuration problems.
推荐答案
这个问题可能是你的RMI服务器发送,而不是广域网地址返回给本地地址。
The Problem could be your RMI server is sending back its local address, instead of WAN address.
System.setProperty("java.rmi.server.hostname", *host IP*);
也看看关于RMI的安全策略: http://docs.oracle.com/javase/tutorial/rmi/running.html
also take a look at security policies regarding RMI: http://docs.oracle.com/javase/tutorial/rmi/running.html
这篇关于无法建立RMI连接到远程计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!