Dubbo+Zookeeper報錯KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented
阿新 • • 發佈:2018-12-02
今天在執行spring-boot + dubbo的時候,zookeeper中註冊的時候丟擲一個異常,檢視到我使用的curator-recipes版本是4.0+版本,依賴的zookeeper是3.5加版本,而我自己的zookeeper是3.4.x版本。
異常資訊
Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to register dubbo://192.168.100.111:20880/com.itstyle.modules.alipay.service.IAliPayService?anyhost=true&application=springboot_pay&default.loadbalance=roundrobin&default.threadpool=fixed&default.threads=10&dubbo=2.6.2&generic=false&interface=com.itstyle.modules.alipay.service.IAliPayService&methods=downloadBillUrl,aliCloseorder,aliPay,appPay,rsaCheckV1,aliPayPc,aliPayMobile,aliRefund,rsaCheckV2&pid=10728&side=provider×tamp=1542872343263 to zookeeper zookeeper://119.23.74.61:2181/com.alibaba.dubbo.registry.RegistryService?application=springboot_pay&dubbo=2.6.2&interface=com.alibaba.dubbo.registry.RegistryService&pid=10728×tamp=1542872343247, cause: KeeperErrorCode = Unimplemented for /dubbo/com.itstyle.modules.alipay.service.IAliPayService/providers/dubbo%3A%2F%2F192.168.100.111%3A20880%2Fcom.itstyle.modules.alipay.service.IAliPayService%3Fanyhost%3Dtrue%26application%3Dspringboot_pay%26default.loadbalance%3Droundrobin%26default.threadpool%3Dfixed%26default.threads%3D10%26dubbo%3D2.6.2%26generic%3Dfalse%26interface%3Dcom.itstyle.modules.alipay.service.IAliPayService%26methods%3DdownloadBillUrl%2CaliCloseorder%2CaliPay%2CappPay%2CrsaCheckV1%2CaliPayPc%2CaliPayMobile%2CaliRefund%2CrsaCheckV2%26pid%3D10728%26side%3Dprovider%26timestamp%3D1542872343263 at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:116) at com.alibaba.dubbo.registry.support.FailbackRegistry.register(FailbackRegistry.java:131) ... 37 common frames omitted Caused by: java.lang.IllegalStateException: KeeperErrorCode = Unimplemented for /dubbo/com.itstyle.modules.alipay.service.IAliPayService/providers/dubbo%3A%2F%2F192.168.100.111%3A20880%2Fcom.itstyle.modules.alipay.service.IAliPayService%3Fanyhost%3Dtrue%26application%3Dspringboot_pay%26default.loadbalance%3Droundrobin%26default.threadpool%3Dfixed%26default.threads%3D10%26dubbo%3D2.6.2%26generic%3Dfalse%26interface%3Dcom.itstyle.modules.alipay.service.IAliPayService%26methods%3DdownloadBillUrl%2CaliCloseorder%2CaliPay%2CappPay%2CrsaCheckV1%2CaliPayPc%2CaliPayMobile%2CaliRefund%2CrsaCheckV2%26pid%3D10728%26side%3Dprovider%26timestamp%3D1542872343263 at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createEphemeral(CuratorZookeeperClient.java:89) at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:63) at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:114) ... 38 common frames omitted Caused by: org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for /dubbo/com.itstyle.modules.alipay.service.IAliPayService/providers/dubbo%3A%2F%2F192.168.100.111%3A20880%2Fcom.itstyle.modules.alipay.service.IAliPayService%3Fanyhost%3Dtrue%26application%3Dspringboot_pay%26default.loadbalance%3Droundrobin%26default.threadpool%3Dfixed%26default.threads%3D10%26dubbo%3D2.6.2%26generic%3Dfalse%26interface%3Dcom.itstyle.modules.alipay.service.IAliPayService%26methods%3DdownloadBillUrl%2CaliCloseorder%2CaliPay%2CappPay%2CrsaCheckV1%2CaliPayPc%2CaliPayMobile%2CaliRefund%2CrsaCheckV2%26pid%3D10728%26side%3Dprovider%26timestamp%3D1542872343263 at org.apache.zookeeper.KeeperException.create(KeeperException.java:103) at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1525) at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1181) at org.apache.curator.framework.imps.CreateBuilderImpl$17.call(CreateBuilderImpl.java:1158) at org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:64) at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:100) at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:1155) at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:605) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:595) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:573) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:49) at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createEphemeral(CuratorZookeeperClient.java:86) ... 40 common frames omitted
參考到該文章:https://blog.csdn.net/sgrrmswtvt/article/details/81129342?utm_source=blogxgwz2
說是由於Zookeeper版本問題,果然我的Zookeeper版本是3.4.x的
檢視到我的pom依賴的zookeeper是3.5.x所以導致這個錯誤
更新版本
<dependency> <groupId>org.apache.curator</groupId> <artifactId>curator-recipes</artifactId> <version>4.0.1</version> 先排除zookeeper <exclusions> <exclusion> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> </exclusion> </exclusions> </dependency> 新增zookeeper3.4.x版本 <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <version>3.4.7</version> </dependency>
修改依賴之後重新執行成功。
如有類似問題歡迎留言,看到會回覆。