3
  java.rmi.ConnectException: Connection refused to host: IPSERVER0.0.0.0.0; nested exception     is: 
java.net.ConnectException: Connection timed out
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:340)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:101)
at StartRMI.go(StartRMI.java:14)
at StartRMI.main(StartRMI.java:6)
    Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:146)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 7 more

当我尝试将远程客户端连接到我的服务器时出现此异常。我的服务器运行良好的 RMI 服务器,并且没有安装防火墙。如何解决这个问题?

4

4 回答 4

2

检查所有网络适配器,有时VM网络适配器会以这种方式干扰。哪个是您当前的localhost,或者127.0.0.1不再是指您的主机名或当前机器,这会产生连接被拒绝的问题。我的一般建议是:

1.To check or disable unwanted VM or Network Adapters

2.Ping 127.0.0.1

3.Disable Firewall and Test if all the above doesn't work 

4.Add security Manager with a policy file on you server if you haven't done that.
于 2013-07-12T07:57:57.610 回答
0

/etc/hosts 文件中的 IPSERVER 是否映射到您想要的 IP 地址?检查执行 ahostname -i或时得到的结果hostname

尝试使用您的 IP 地址而不是域名。

于 2013-07-09T04:41:13.493 回答
0

Try to start the RMI registry using

start rmiregistry 

for default port or

rmiregistry <port_no> 

for a specified port.

于 2014-03-10T16:51:46.740 回答
0

您没有提到您使用的是哪个操作系统,如果在代码和防火墙方面一切都正确,那么您可能需要检查主机条目或 ip 表规则。

于 2013-07-09T04:27:41.613 回答