javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: DSC-ABN-1; nested exception is:
java.net.ConnectException: Connection refused: connect]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:803)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:568)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
Caused by: java.rmi.ConnectException: Connection refused to host: DSC-ABN-1; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:621)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:606)
... 4 more
Caused by: java.rmi.ConnectException: Connection refused to host: DSC-ABN-1; nested exception is: 还有个什么连接异常
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:621)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:606)
在NamingContext.java 中执行 lookup时 ---->newConnection--
>createConnection-->newSocket--->然后就出现了连接被断开了。查查哪个部位出问题了。
把localhost换成127.0.0.1再试试喽