求帮助:mina 初学 客户端连接不上 无法获得session 对象
org.apache.mina.core.RuntimeIoException: Failed to get the session.at org.apache.mina.core.future.DefaultConnectFuture.getSession(DefaultConnectFuture.java:60)
at cn.com.String.MessageClient.main(MessageClient.java:41)
Caused by: java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.mina.transport.socket.nio.NioSocketConnector.finishConnect(NioSocketConnector.java:224)
at org.apache.mina.transport.socket.nio.NioSocketConnector.finishConnect(NioSocketConnector.java:46)
at org.apache.mina.core.polling.AbstractPollingIoConnector.processConnections(AbstractPollingIoConnector.java:439)
at org.apache.mina.core.polling.AbstractPollingIoConnector.access$700(AbstractPollingIoConnector.java:64)
at org.apache.mina.core.polling.AbstractPollingIoConnector$Connector.run(AbstractPollingIoConnector.java:508)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Exception in thread "main" java.lang.NullPointerException
at cn.com.String.MessageClient.main(MessageClient.java:51) --------------------编程问答-------------------- Caused by: java.net.ConnectException: Connection refused: no further information
这句的大致意思是:连接错误:连接被拒绝,没有较进一步的数据。
你是不是查看一下你的连接。
补充:Java , Web 开发