ERROR org.apache.curator.framework.imps.CuratorFrameworkImpl Background exception was not retry-able or retry gave up [main-EventThread] java.lang.NullPointerException at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106) at org.apache.curator.framework.imps.EnsembleTracker.processConfigData(EnsembleTracker.java:163) at org.apache.curator.framework.imps.EnsembleTracker.access$200(EnsembleTracker.java:48) at org.apache.curator.framework.imps.EnsembleTracker$2.processResult(EnsembleTracker.java:134) at org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:829) at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:611) at org.apache.curator.framework.imps.WatcherRemovalFacade.processBackgroundOperation(WatcherRemovalFacade.java:151) at org.apache.curator.framework.imps.GetConfigBuilderImpl$2.processResult(GetConfigBuilderImpl.java:210) at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:619) at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:528)
使用curtor包操作zookeeper报错。
依赖包兼容问题,意思大概是Curator 2.x.x-兼容两个zk 3.4.x 和zk 3.5.x,Curator 3.x.x-兼容兼容zk 3.5。
<dependency> <groupId>org.apache.curator</groupId> <artifactId>curator-framework</artifactId> <version>2.10.0</version> </dependency>
更换版本之后问题解决。
注意版本问题,版本3.x.x需要jdk1.8版本。