解決dubbo啟動(dòng)報(bào)服務(wù)注冊(cè)失敗Failed?to?register?dubbo
dubbo 啟動(dòng)報(bào) 服務(wù)注冊(cè)失敗Failed to register dubbo
java.lang.IllegalStateException: Failed to register dubbo://192.168.187.1:20880/com.ghg.dubbo.api.GreetingService?anyhost=true&application=demo-provider&bean.name=com.ghg.dubbo.api.GreetingService&dubbo=2.0.2&generic=false&interface=com.ghg.dubbo.api.Gre
日志
Exception in thread "main" java.lang.IllegalStateException: Failed to register dubbo://192.168.187.1:20880/com.ghg.dubbo.api.GreetingService?anyhost=true&application=demo-provider&bean.name=com.ghg.dubbo.api.GreetingService&dubbo=2.0.2&generic=false&interface=com.ghg.dubbo.api.GreetingService&methods=sayHello&pid=9092&side=provider×tamp=1545384997858 to registry 127.0.0.1:2181, cause: Failed to register dubbo://192.168.187.1:20880/com.ghg.dubbo.api.GreetingService?anyhost=true&application=demo-provider&bean.name=com.ghg.dubbo.api.GreetingService&dubbo=2.0.2&generic=false&interface=com.ghg.dubbo.api.GreetingService&methods=sayHello&pid=9092&side=provider×tamp=1545384997858 to zookeeper zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=demo-provider&dubbo=2.0.2&interface=com.alibaba.dubbo.registry.RegistryService&pid=9092×tamp=1545384997854, cause: KeeperErrorCode = Unimplemented for /dubbo/com.ghg.dubbo.api.GreetingService/providers/dubbo%3A%2F%2F192.168.187.1%3A20880%2Fcom.ghg.dubbo.api.GreetingService%3Fanyhost%3Dtrue%26application%3Ddemo-provider%26bean.name%3Dcom.ghg.dubbo.api.GreetingService%26dubbo%3D2.0.2%26generic%3Dfalse%26interface%3Dcom.ghg.dubbo.api.GreetingService%26methods%3DsayHello%26pid%3D9092%26side%3Dprovider%26timestamp%3D1545384997858
at com.alibaba.dubbo.registry.support.FailbackRegistry.register(FailbackRegistry.java:150)
at com.alibaba.dubbo.registry.integration.RegistryProtocol.register(RegistryProtocol.java:126)
at com.alibaba.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:146)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:98)
at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:60)
at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:55)
at com.alibaba.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:513)
at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:358)
at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:317)
at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:216)
at com.alibaba.dubbo.config.spring.ServiceBean.export(ServiceBean.java:291)
at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:131)
at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:53)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at com.ghgcn.dubbo.Main.main(Main.java:11)
Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to register dubbo://192.168.187.1:20880/com.ghg.dubbo.api.GreetingService?anyhost=true&application=demo-provider&bean.name=com.ghg.dubbo.api.GreetingService&dubbo=2.0.2&generic=false&interface=com.ghg.dubbo.api.GreetingService&methods=sayHello&pid=9092&side=provider×tamp=1545384997858 to zookeeper zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=demo-provider&dubbo=2.0.2&interface=com.alibaba.dubbo.registry.RegistryService&pid=9092×tamp=1545384997854, cause: KeeperErrorCode = Unimplemented for /dubbo/com.ghg.dubbo.api.GreetingService/providers/dubbo%3A%2F%2F192.168.187.1%3A20880%2Fcom.ghg.dubbo.api.GreetingService%3Fanyhost%3Dtrue%26application%3Ddemo-provider%26bean.name%3Dcom.ghg.dubbo.api.GreetingService%26dubbo%3D2.0.2%26generic%3Dfalse%26interface%3Dcom.ghg.dubbo.api.GreetingService%26methods%3DsayHello%26pid%3D9092%26side%3Dprovider%26timestamp%3D1545384997858
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:116)
at com.alibaba.dubbo.registry.support.FailbackRegistry.register(FailbackRegistry.java:137)
... 23 more
Caused by: java.lang.IllegalStateException: KeeperErrorCode = Unimplemented for /dubbo/com.ghg.dubbo.api.GreetingService/providers/dubbo%3A%2F%2F192.168.187.1%3A20880%2Fcom.ghg.dubbo.api.GreetingService%3Fanyhost%3Dtrue%26application%3Ddemo-provider%26bean.name%3Dcom.ghg.dubbo.api.GreetingService%26dubbo%3D2.0.2%26generic%3Dfalse%26interface%3Dcom.ghg.dubbo.api.GreetingService%26methods%3DsayHello%26pid%3D9092%26side%3Dprovider%26timestamp%3D1545384997858
at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createEphemeral(CuratorZookeeperClient.java:89)
at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:65)
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:114)
... 24 more
Caused by: org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for /dubbo/com.ghg.dubbo.api.GreetingService/providers/dubbo%3A%2F%2F192.168.187.1%3A20880%2Fcom.ghg.dubbo.api.GreetingService%3Fanyhost%3Dtrue%26application%3Ddemo-provider%26bean.name%3Dcom.ghg.dubbo.api.GreetingService%26dubbo%3D2.0.2%26generic%3Dfalse%26interface%3Dcom.ghg.dubbo.api.GreetingService%26methods%3DsayHello%26pid%3D9092%26side%3Dprovider%26timestamp%3D1545384997858
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)
... 26 more
2018-12-21 17:36:39 [main-EventThread] INFO o.a.c.f.state.ConnectionStateManager -
State change: SUSPENDED
2018-12-21 17:36:39 [DubboShutdownHook] DEBUG org.apache.curator.RetryLoop -
Retry-able exception received
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /dubbo/com.ghg.dubbo.api.GreetingService/providers/dubbo%3A%2F%2F192.168.187.1%3A20880%2Fcom.ghg.dubbo.api.GreetingService%3Fanyhost%3Dtrue%26application%3Ddemo-provider%26bean.name%3Dcom.ghg.dubbo.api.GreetingService%26dubbo%3D2.0.2%26generic%3Dfalse%26interface%3Dcom.ghg.dubbo.api.GreetingService%26methods%3DsayHello%26pid%3D9092%26side%3Dprovider%26timestamp%3D1545384997858
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.delete(ZooKeeper.java:1681)
at org.apache.curator.framework.imps.DeleteBuilderImpl$5.call(DeleteBuilderImpl.java:274)
at org.apache.curator.framework.imps.DeleteBuilderImpl$5.call(DeleteBuilderImpl.java:268)
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.DeleteBuilderImpl.pathInForeground(DeleteBuilderImpl.java:265)
at org.apache.curator.framework.imps.DeleteBuilderImpl.forPath(DeleteBuilderImpl.java:249)
at org.apache.curator.framework.imps.DeleteBuilderImpl.forPath(DeleteBuilderImpl.java:34)
at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.delete(CuratorZookeeperClient.java:96)
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doUnregister(ZookeeperRegistry.java:123)
at com.alibaba.dubbo.registry.support.FailbackRegistry.unregister(FailbackRegistry.java:167)
at com.alibaba.dubbo.registry.support.AbstractRegistry.destroy(AbstractRegistry.java:458)
at com.alibaba.dubbo.registry.support.FailbackRegistry.destroy(FailbackRegistry.java:443)
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.destroy(ZookeeperRegistry.java:103)
at com.alibaba.dubbo.registry.support.AbstractRegistryFactory.destroyAll(AbstractRegistryFactory.java:71)
at com.alibaba.dubbo.config.DubboShutdownHook.destroyAll(DubboShutdownHook.java:69)
at com.alibaba.dubbo.config.DubboShutdownHook.run(DubboShutdownHook.java:58)
2018-12-21 17:36:40 [DubboShutdownHook] DEBUG org.apache.curator.RetryLoop -
Retrying operation
2018-12-21 17:36:40 [main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn -
Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2018-12-21 17:36:40 [main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn -
Socket connection established, initiating session, client: /127.0.0.1:63688, server: 127.0.0.1/127.0.0.1:2181
2018-12-21 17:36:40 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn -
Session establishment request sent on 127.0.0.1/127.0.0.1:2181
2018-12-21 17:36:40 [main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn -
Session establishment complete on server 127.0.0.1/127.0.0.1:2181, sessionid = 0x167cfc769cd0009, negotiated timeout = 40000
2018-12-21 17:36:40 [main-EventThread] DEBUG org.apache.curator.ConnectionState -
Negotiated session timeout: 40000
2018-12-21 17:36:40 [main-EventThread] INFO o.a.c.f.state.ConnectionStateManager -
State change: RECONNECTED
2018-12-21 17:36:40 [main-EventThread] DEBUG o.a.c.f.imps.CuratorFrameworkImpl -
Clearing sleep for 0 operations
2018-12-21 17:36:40 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn -
Reading reply sessionid:0x167cfc769cd0009, packet:: clientPath:null serverPath:null finished:false header:: 5,2 replyHeader:: 5,1070232,-101 request:: '/dubbo/com.ghg.dubbo.api.GreetingService/providers/dubbo%253A%252F%252F192.168.187.1%253A20880%252Fcom.ghg.dubbo.api.GreetingService%253Fanyhost%253Dtrue%2526application%253Ddemo-provider%2526bean.name%253Dcom.ghg.dubbo.api.GreetingService%2526dubbo%253D2.0.2%2526generic%253Dfalse%2526interface%253Dcom.ghg.dubbo.api.GreetingService%2526methods%253DsayHello%2526pid%253D9092%2526side%253Dprovider%2526timestamp%253D1545384997858,-1 response:: null
2018-12-21 17:36:40 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn -
Reading reply sessionid:0x167cfc769cd0009, packet:: clientPath:/zookeeper/config serverPath:/zookeeper/config finished:false header:: 6,4 replyHeader:: 6,1070232,-101 request:: '/zookeeper/config,T response::
2018-12-21 17:36:40 [DubboShutdownHook] DEBUG o.a.c.f.imps.CuratorFrameworkImpl -
Closing
2018-12-21 17:36:40 [Curator-Framework-0] INFO o.a.c.f.imps.CuratorFrameworkImpl -
backgroundOperationsLoop exiting
2018-12-21 17:36:40 [DubboShutdownHook] DEBUG o.a.curator.CuratorZookeeperClient -
Closing
2018-12-21 17:36:40 [DubboShutdownHook] DEBUG org.apache.curator.ConnectionState -
Closing
2018-12-21 17:36:40 [DubboShutdownHook] DEBUG org.apache.zookeeper.ZooKeeper -
Closing session: 0x167cfc769cd0009
2018-12-21 17:36:40 [DubboShutdownHook] DEBUG org.apache.zookeeper.ClientCnxn -
Closing client for session: 0x167cfc769cd0009
2018-12-21 17:36:40 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn -
Reading reply sessionid:0x167cfc769cd0009, packet:: clientPath:null serverPath:null finished:false header:: 7,-11 replyHeader:: 7,1070233,0 request:: null response:: null
2018-12-21 17:36:40 [DubboShutdownHook] DEBUG org.apache.zookeeper.ClientCnxn -
Disconnecting client for session: 0x167cfc769cd0009
2018-12-21 17:36:40 [DubboShutdownHook] INFO org.apache.zookeeper.ZooKeeper -
Session: 0x167cfc769cd0009 closed
2018-12-21 17:36:40 [main-EventThread] INFO org.apache.zookeeper.ClientCnxn -
EventThread shut down for session: 0x167cfc769cd0009
這里的問(wèn)題主要是服務(wù)端的zookeeper版本和客戶端的zookeeper版本不同。
我這里的zookeeper的服務(wù)端版本是3.4,客戶端版本是3.5,然后就會(huì)導(dǎo)致各種各樣的問(wèn)題。
這里我們只要降低一下curator-framework的版本就可以了,
<version.curator>2.12.0</version.curator> <dependency> <groupId>org.apache.curator</groupId> <artifactId>curator-framework</artifactId> <version>${version.curator}</version> </dependency>
最終啟動(dòng)成功!
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Java8實(shí)戰(zhàn)之Stream的延遲計(jì)算
JDK中Stream的中間函數(shù)如 filter(Predicate super T>)是惰性求值的,filter并非對(duì)流中所有元素調(diào)用傳遞給它的Predicate,下面這篇文章主要給大家介紹了關(guān)于Java8實(shí)戰(zhàn)之Stream延遲計(jì)算的相關(guān)資料,需要的朋友可以參考下2021-09-09SpringBoot啟動(dòng)java.nio.charset.MalformedInputException: I
本文主要介紹了SpringBoot啟動(dòng)java.nio.charset.MalformedInputException: Input length = 1報(bào)錯(cuò)的解決方案2023-07-07Java反射學(xué)習(xí) getClass()函數(shù)應(yīng)用
所謂反射,可以理解為在運(yùn)行時(shí)期獲取對(duì)象類型信息的操作,本文將詳細(xì)介紹,需要的朋友可以參考下2012-12-12Mybatis如何從數(shù)據(jù)庫(kù)中獲取數(shù)據(jù)存為L(zhǎng)ist類型(存為model)
這篇文章主要介紹了Mybatis如何從數(shù)據(jù)庫(kù)中獲取數(shù)據(jù)存為L(zhǎng)ist類型(存為model),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-01-01如何開(kāi)啟控制臺(tái)輸出mybatis執(zhí)行的sql日志問(wèn)題
這篇文章主要介紹了如何開(kāi)啟控制臺(tái)輸出mybatis執(zhí)行的sql日志問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-09-09Java實(shí)現(xiàn)電影院訂票系統(tǒng)代碼
這篇文章主要介紹了Java實(shí)現(xiàn)電影院訂票系統(tǒng)代碼,代碼實(shí)現(xiàn)了界面類登錄注冊(cè)類,用戶類等,具有一定參考價(jià)值,需要的朋友可以參考下。2017-11-11Java系統(tǒng)運(yùn)行緩慢等問(wèn)題的排查思路
這篇文章主要介紹了Java系統(tǒng)運(yùn)行緩慢等問(wèn)題的排查思路,讀者可以根據(jù)具體情況具體分析,從而解決問(wèn)題2021-04-04Mybatis-plus多數(shù)據(jù)源配置的兩種方式總結(jié)
這篇文章主要為大家詳細(xì)介紹了Mybatis-plus中多數(shù)據(jù)源配置的兩種方式,文中的示例代碼簡(jiǎn)潔易懂,感興趣的小伙伴可以跟隨小編一起了解一下2022-10-10Java實(shí)現(xiàn)畫(huà)圖 給圖片底部添加文字標(biāo)題
這篇文章主要介紹了Java實(shí)現(xiàn)畫(huà)圖 給圖片底部添加文字標(biāo)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2021-11-11idea2023創(chuàng)建JavaWeb教程之右鍵沒(méi)有Servlet的問(wèn)題解決
最近在寫(xiě)一個(gè)javaweb項(xiàng)目,但是在IDEA中創(chuàng)建好項(xiàng)目后,在搭建結(jié)構(gòu)的時(shí)候創(chuàng)建servlet文件去沒(méi)有選項(xiàng),所以這里給大家總結(jié)下,這篇文章主要給大家介紹了關(guān)于idea2023創(chuàng)建JavaWeb教程之右鍵沒(méi)有Servlet問(wèn)題的解決方法,需要的朋友可以參考下2023-10-10