SpringBoot與Dubbo整合報錯排查(Nacos作為註冊中心)
異常資訊:
java.lang.IllegalStateException: No such extension org.apache.dubbo.registry.RegistryFactory by name nacos
檢視SpringBoot與Dubbo整合依賴的jar包
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>2.7.5</version>
<exclusions>
<exclusion>
<artifactId>org.apache.dubbo</artifactId>
<groupId>dubbo</groupId>
</exclusion>
</exclusions>
</dependency>
及專案啟動日誌資訊:
2020-05-07 12:32:27.154 INFO 46384 --- [ main] .b.c.e.AwaitingNonWebApplicationListener : [Dubbo] Current Spring Boot Application is about to shutdown...
2020-05-07 12:32:27.154 INFO 46384 --- [ main] o.a.d.r.support.AbstractRegistryFactory : [DUBBO] Close all registries [], dubbo version: 2.7.1, current host: 192.168.227.1
2020-05-07 12:32:27.154 INFO 46384 --- [ main] o.a.d.rpc.protocol.dubbo.DubboProtocol : [DUBBO] Close dubbo server: /192.168.227.1:20880, dubbo version: 2.7.1, current host: 192.168.227.1
2020-05-07 12:32:27.156 INFO 46384 --- [ main] o.a.d.remoting.transport.AbstractServer : [DUBBO] Close NettyServer bind /0.0.0.0:20880, export /192.168.227.1:20880, dubbo version: 2.7.1, current host: 192.168.227.1
2020-05-07 12:32:27.165 INFO 46384 --- [ main] o.a.d.rpc.protocol.dubbo.DubboProtocol : [DUBBO] Unexport service: dubbo://192.168.227.1:20880/com.search.dubbo.springcloud.nacos.api.IHelloService?anyhost=true&application=spring-boot-dubbo-nacos-provider&bean.name=providers:dubbo:com.search.dubbo.springcloud.nacos.api.IHelloService:1.0.0:HelloGroup&bind.ip=192.168.227.1&bind.port=20880&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&group=HelloGroup&interface=com.search.dubbo.springcloud.nacos.api.IHelloService&methods=sayHello&pid=46384®ister=true&release=2.7.1&revision=1.0.0&side=provider×tamp=1588825945715&version=1.0.0, dubbo version: 2.7.1, current host: 192.168.227.1
2020-05-07 12:32:27.165 INFO 46384 --- [ main] org.apache.dubbo.qos.server.Server : [DUBBO] qos-server stopped., dubbo version: 2.7.1, current host: 192.168.227.1
2020-05-07 12:32:27.173 INFO 46384 --- [ main] o.a.d.rpc.protocol.injvm.InjvmProtocol : [DUBBO] Unexport service: injvm://127.0.0.1/com.search.dubbo.springcloud.nacos.api.IHelloService?anyhost=true&application=spring-boot-dubbo-nacos-provider&bean.name=providers:dubbo:com.search.dubbo.springcloud.nacos.api.IHelloService:1.0.0:HelloGroup&bind.ip=192.168.227.1&bind.port=20880&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&group=HelloGroup&interface=com.search.dubbo.springcloud.nacos.api.IHelloService&methods=sayHello&pid=46384®ister=true&release=2.7.1&revision=1.0.0&side=provider×tamp=1588825945715&version=1.0.0, dubbo version: 2.7.1, current host: 192.168.227.1
2020-05-07 12:32:27.174 WARN 46384 --- [ main] o.apache.dubbo.config.DubboShutdownHook : [DUBBO] No such extension org.apache.dubbo.registry.RegistryFactory by name nacos, dubbo version: 2.7.1, current host: 192.168.227.1
java.lang.IllegalStateException: No such extension org.apache.dubbo.registry.RegistryFactory by name nacos
at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:516) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:523) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:347) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:273) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.registry.integration.RegistryProtocol.access$1100(RegistryProtocol.java:95) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.registry.integration.RegistryProtocol$ExporterChangeableWrapper.unexport(RegistryProtocol.java:644) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.registry.integration.RegistryProtocol.destroy(RegistryProtocol.java:417) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.destroy(ProtocolListenerWrapper.java:75) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.destroy(ProtocolFilterWrapper.java:121) ~[dubbo-2.7.1.jar:2.7.1]
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.destroy(QosProtocolWrapper.java:77) ~[dubbo-2.7.1.jar:2.7.1]
執行時使用的dubbo版本為2.7.1
解決方案: 升級Dubbo的包
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>2.7.5</version>
</dependency>
專案啟動日誌資訊:
相關文章
- SpringBoot整合Dubbo,註冊中心nacosSpring Boot
- Dubbo:Nacos作為註冊中心
- Dubbo與SpringCloud Alibaba使用Nacos作為配置中心和註冊中心SpringGCCloud
- Dubbo使用nacos作為註冊中心原理剖析
- springboot整合nacos註冊中心和配置中心Spring Boot
- Dubbo使用Nacos註冊中心
- SpringBoot使用Nacos作為配置中心服務和服務註冊中心Spring Boot
- springboot工程dubbo使用nacos作為配置中心Spring Boot
- 整合 nacos註冊中心配置使用
- springcloud/springboot整合NACOS 做註冊和配置中心以及nacos原始碼分析GCCloudSpring Boot原始碼
- Spring Cloud Alibaba:Nacos 作為註冊中心和配置中心使用SpringCloud
- 手動造輪子——為Ocelot整合Nacos註冊中心
- springboot+dubbo+nacos整合Spring Boot
- nacos-dubbo-springboot整合Spring Boot
- Spring Cloud Alibaba 使用Nacos作為服務註冊中心SpringCloud
- 為什麼阿里的dubbo註冊中心要放棄zookeeper, 而用Nacos?阿里
- 初探Nacos(三)-- SpringBoot下整合Dubbo和NacosSpring Boot
- 初探Nacos(四)-- SpringBoot下使用Nacos作為配置中心Spring Boot
- Nacos註冊與配置中心:使用詳講
- Springboot + Dubbo + Nacos微服務框架整合Spring Boot微服務框架
- SpringBoot專案使用Nacos作為配置中心Spring Boot
- Spring Cloud 註冊Nacos註冊中心啟動報錯:failed to req API:/nacos/v1/ns/instance after all servers....SpringCloudAIAPIServer
- Nacos註冊中心+配置管理
- Dubbo 穩定性案例:Nacos 註冊中心可用性問題覆盤
- 使用nacos做dubbo的註冊中心服務列表沒有資料
- Dubbo系列之 (二)Registry註冊中心-註冊(1)
- Dubbo系列之 (二)Registry註冊中心-註冊(2)
- nacos註冊中心原始碼流程分析原始碼
- Spring Cloud Alibaba(4)---Nacos(註冊中心)SpringCloud
- nacos作為配置中心
- SpringCloud之使用Zookeeper作為註冊中心SpringGCCloud
- SpringCloud整合Consul註冊中心SpringGCCloud
- Dubbo 中 Zookeeper 註冊中心原理分析
- consul 作為服務註冊與發現和配置中心
- naocs 作為服務註冊與發現和配置中心
- Apache Dubbo 原始碼搭建與解讀(八)—— Dubbo 註冊中心之ZooKeeperApache原始碼
- SpringCloudAlibaba - 整合 Nacos 實現服務註冊與發現SpringGCCloud
- SpringCloudAlibaba註冊中心與配置中心之利器Nacos實戰與原始碼分析(中)SpringGCCloud原始碼