WebLogic 连接 RMI 服务报错 Connection refused
访问 WebLogic RMI 服务报错,连接被拒绝,连接超时。
奇怪的是,报错的 host 根本不是我要访问的。
报错
Caused by: java.rmi.ConnectException: Connection refused to host: 192.168.2.25; nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:631)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:228)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:214)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:140)
at psdi.server.MXServer_Stub.lookup(Unknown Source)
at psdi.util.RMISession.authenticateUser(RMISession.java:304)
at psdi.util.RMISession.loadUserInfo(RMISession.java:200)
at psdi.util.RMISession.connect(RMISession.java:61)
... 1 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:80)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:369)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:176)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:402)
at java.net.Socket.connect(Socket.java:590)
at java.net.Socket.connect(Socket.java:539)
at java.net.Socket.<init>(Socket.java:436)
at java.net.Socket.<init>(Socket.java:219)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:52)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:158)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:625)
... 8 more
找到了官网的描述 Unable to connect to remote RMI service when using multi-homed interface
在 WebLogic 启动参数中添加 -Djava.rmi.server.hostname=真实IP