[英]java.rmi.ConnectException: Connection refused to host:
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
I get this exception when I try to connect a remote client to my server. 当我尝试将远程客户端连接到服务器时,出现此异常。 My Server is running RMI Server fine, and there no firewall installed.
我的服务器运行RMI Server正常,并且没有安装防火墙。 How to fix that issue ?
如何解决该问题?
Check all you network adapters ,some time a VM network adapter interferes in this way . 检查所有网络适配器,有时VM网络适配器会以这种方式进行干扰。 Which is you current
localhost
or 127.0.0.1
is not any more referring to you host name or current machine ,which then create a connection refused problem. 您当前使用的是
localhost
还是127.0.0.1
不再引用您的主机名或当前计算机,这将导致连接被拒绝的问题。 My General Recommendation is: 我的一般建议是:
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.
您没有提到要使用哪个OS,如果在代码和防火墙方面一切都正确,则可能需要检查主机条目或ip表规则。
Is IPSERVER mapped in /etc/hosts file to the IP address you want? IPSERVER是否在/ etc / hosts文件中映射到您想要的IP地址? Check what you get when you do a
hostname -i
or hostname
. 检查执行
hostname -i
或hostname
。
Try putting your IP address instead of the domain name. 尝试输入您的IP地址而不是域名。
Try to start the RMI registry using 尝试使用启动RMI注册表
start rmiregistry
for default port or 用于默认端口或
rmiregistry <port_no>
for a specified port. 用于指定的端口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.