错误提示WARN - Session 0x0 for server null, unexpected error, closing socket connection and attempting

时间:2021-03-06 07:38:39

此项目 在myeclipse2014版本上正常启动。现在由于要上新项目,最低需要JDK1.8,所以升级到Myeclipse2017版本。JDK也重新安装了jdk1.8.0_162(64位)SVN检出项目,添加到 tomcat8.0 选择Exploed,启动。报错信息如下:

【报错信息中的ZookKeeper连接地址是被隐藏的】

dubbo version: 2.5.3, current host: 127.0.0.1
DEBUG - Creating new ZookKeeper instance to connect to 00.00.000.00:0000
INFO  - Starting ZkClient event thread.
INFO  - Client environment:zookeeper.version=3.4.8--1, built on 02/06/2016 03:18 GMT
INFO  - Client environment:host.name=100.100.211.170
INFO  - Client environment:java.version=1.8.0_162
INFO  - Client environment:java.vendor=Oracle Corporation
INFO  - Client environment:java.home=D:\Program Files\Java\jdk1.8.0_162\jre
INFO  - Client environment:java.class.path=D:\Program Files\Java\jdk1.8.0_162\lib\tools.jar;D:\Program Files\Java\apache-tomcat-8.0.43\bin\bootstrap.jar;D:\Program Files\Java\apache-tomcat-8.0.43\bin\tomcat-juli.jar
INFO  - Client environment:java.library.path=D:\Program Files\Java\jdk1.8.0_162\bin;D:\Program Files\Java\apache-tomcat-8.0.43\bin
INFO  - Client environment:java.io.tmpdir=C:\diannao\diannao\AppData\Local\Temp\
INFO  - Client environment:java.compiler=<NA>
INFO  - Client environment:os.name=Windows 10
INFO  - Client environment:os.arch=amd64
INFO  - Client environment:os.version=10.0
INFO  - Client environment:user.name=diannao
INFO  - Client environment:user.home=C:\diannao\diannao
INFO  - Client environment:user.dir=D:\Program Files\MyEclipse2017
INFO  - Initiating client connection, connectString=00.00.000.00:0000 sessionTimeout=30000 watcher=org.I0Itec.zkclient.ZkClient@622f7e4a
DEBUG - zookeeper.disableAutoWatchReset is false
DEBUG - Awaiting connection to Zookeeper server
DEBUG - Waiting for keeper state SyncConnected
INFO  - Opening socket connection to server 22.33.444.00/22.33.444.00:8080. Will not attempt to authenticate using SASL (unknown error)
WARN  - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection timed out: no further information

    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
DEBUG - Ignoring exception during shutdown input
java.nio.channels.ClosedChannelException
    at sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:780)
    at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:399)
    at org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java:200)
    at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1246)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1170)
DEBUG - Ignoring exception during shutdown output
java.nio.channels.ClosedChannelException
    at sun.nio.ch.SocketChannelImpl.shutdownOutput(SocketChannelImpl.java:797)
    at sun.nio.ch.SocketAdaptor.shutdownOutput(SocketAdaptor.java:407)
    at org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java:207)
    at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1246)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1170)
INFO  - Opening socket connection to server 00.00.000.00/00.00.000.00:0000. Will not attempt to authenticate using SASL (unknown error)


问题解决:从这句话 INFO  - Opening socket connection to server 22.33.444.00/22.33.444.00:8080. Will not attempt to authenticate using SASL (unknown error) 可以看出来,是连接的地址出错。如果是本地的Zookeeper,地址是127.0.0.1,如果不是本地的,确认远程连接地址正确,并且Zookeeper已启动。在 配置文件spring-dubbo-consumer.xml中修改。