dubbo+zookeeper报错KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented forXXXXXX

今天在弄dubbo的时候,到zookeeper中注册的时候抛出一个异常如下,后来在查阅资料的时候发现我使用curator-framework的版本是4.0+版本,在它的官网中说使用4.0在支持ZooKeeper 3.4.x集合需要排除依赖ZooKeeper
官网提示:http://curator.apache.org/zk-compatibility.html

官网上是这么说的:
ZooKeeper 3.5.x
    Curator 4.0 has a hard dependency on ZooKeeper 3.5.x
    If you are using ZooKeeper 3.5.x there's nothing additional to do - just use Curator 4.0
ZooKeeper 3.4.x
    Curator 4.0 supports ZooKeeper 3.4.x ensembles in a soft-compatibility mode. To use this mode you must exclude ZooKeeper when adding Curator to your dependency management tool.

gradle如下排除依赖即可

compile ("org.apache.curator:curator-framework:4.0.0") {
            exclude group: 'org.apache.zookeeper', module: 'zookeeper'
 }

异常信息

com.alibaba.dubbo.rpc.RpcException: Failed to register dubbo://192.168.56.1:20881/xxx.xxx.service.UserService?anyhost=true&application=provider&dubbo=2.6.2&generic=false&interface=xxx.xxx.service.UserService&methods=saveUser&pid=6676&side=provider×tamp=1532056521679 to zookeeper zookeeper://10.10.0.20:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.6.2&interface=com.alibaba.dubbo.registry.RegistryService&pid=6676×tamp=1532056521671, cause: KeeperErrorCode = Unimplemented for /dubbo/xxx.xxx.service.UserService/providers/dubbo%3A%2F%2F192.168.56.1%3A20881%2Fxxx.xxx.service.UserService%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.6.2%26generic%3Dfalse%26interface%3Dxxx.xxx.service.UserService%26methods%3DsaveUser%26pid%3D6676%26side%3Dprovider%26timestamp%3D1532056521679
    at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:116) ~[dubbo-2.6.2.jar:2.6.2]
    at com.alibaba.dubbo.registry.support.FailbackRegistry.retry(FailbackRegistry.java:315) [dubbo-2.6.2.jar:2.6.2]
    at com.alibaba.dubbo.registry.support.FailbackRegistry$1.run(FailbackRegistry.java:68) [dubbo-2.6.2.jar:2.6.2]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_171]
    at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308) [?:1.8.0_171]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java) [?:1.8.0_171]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_171]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_171]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
Caused by: java.lang.IllegalStateException: KeeperErrorCode = Unimplemented for /dubbo/xxx.xxx.service.UserService/providers/dubbo%3A%2F%2F192.168.56.1%3A20881%2Fxxx.xxx.service.UserService%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.6.2%26generic%3Dfalse%26interface%3Dxxx.xxx.service.UserService%26methods%3DsaveUser%26pid%3D6676%26side%3Dprovider%26timestamp%3D1532056521679
    at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createEphemeral(CuratorZookeeperClient.java:89) ~[dubbo-2.6.2.jar:2.6.2]
    at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:63) ~[dubbo-2.6.2.jar:2.6.2]
    at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:114) ~[dubbo-2.6.2.jar:2.6.2]
    ... 10 more
Caused by: org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for /dubbo/xxx.xxx.service.UserService/providers/dubbo%3A%2F%2F192.168.56.1%3A20881%2Fxxx.xxx.service.UserService%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.6.2%26generic%3Dfalse%26interface%3Dxxx.xxx.service.UserService%26methods%3DsaveUser%26pid%3D6676%26side%3Dprovider%26timestamp%3D1532056521679
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:103) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
    at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1525) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
    at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1189) ~[curator-framework-4.0.0.jar:4.0.0]
    at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1166) ~[curator-framework-4.0.0.jar:4.0.0]
    at org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:64) ~[curator-client-4.0.0.jar:?]
    at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:100) ~[curator-client-4.0.0.jar:?]
    at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:1163) ~[curator-framework-4.0.0.jar:4.0.0]
    at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:603) ~[curator-framework-4.0.0.jar:4.0.0]
    at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:593) ~[curator-framework-4.0.0.jar:4.0.0]
    at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:571) ~[curator-framework-4.0.0.jar:4.0.0]
    at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:47) ~[curator-framework-4.0.0.jar:4.0.0]
    at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createEphemeral(CuratorZookeeperClient.java:86) ~[dubbo-2.6.2.jar:2.6.2]
    at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:63) ~[dubbo-2.6.2.jar:2.6.2]
    at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:114) ~[dubbo-2.6.2.jar:2.6.2]

你可能感兴趣的:(JAVA)