huaweicloud / dubbo-servicecomb

Dubbo-Serivcecomb provide extensions for Apache Dubbo to using Cloud Service Engine, so that Dubbo users can use service center, config center and governance features.
Apache License 2.0
22 stars 14 forks source link

dubbo-serviceComb使用带https的注册中心和配置中心的CSE时,报错 #127

Open wanlinxiang opened 2 years ago

wanlinxiang commented 2 years ago

使用官方的dubbo集成CSE的demo,CSE的注册中心和配置中心替换成https的地址时,报错。日志如下:

13/12/21 18:59:22:819 CST] main INFO config.ServiceConfig: [DUBBO] No valid ip found from environment, try to find valid host from DNS., dubbo version: 2.7.8, current host: 172.16.1.252 [13/12/21 18:59:22:866 CST] main INFO config.ServiceConfig: [DUBBO] Export dubbo service com.huaweicloud.samples.basic.ProviderService to local registry url : injvm://127.0.0.1/com.huaweicloud.samples.basic.ProviderService?anyhost=true&application=price-provider&bind.ip=172.16.1.252&bind.port=8082&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=com.huaweicloud.samples.basic.ProviderService&methods=sayHello&pid=5196&qos.port=22222&release=2.7.8&side=provider&timestamp=1639393162801, dubbo version: 2.7.8, current host: 172.16.1.252 [13/12/21 18:59:22:867 CST] main INFO config.ServiceConfig: [DUBBO] Register dubbo service com.huaweicloud.samples.basic.ProviderService url dubbo://172.16.1.252:8082/com.huaweicloud.samples.basic.ProviderService?anyhost=true&application=price-provider&bind.ip=172.16.1.252&bind.port=8082&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=com.huaweicloud.samples.basic.ProviderService&methods=sayHello&pid=5196&qos.port=22222&release=2.7.8&side=provider&timestamp=1639393162801 to registry registry://192.168.0.150:30100,https::9090/192.168.0.30:30100?application=price-provider&dubbo=2.0.2&pid=5196&qos.port=22222&registry=https&release=2.7.8&timestamp=1639393162799, dubbo version: 2.7.8, current host: 172.16.1.252 [13/12/21 18:59:23:081 CST] main INFO transport.AbstractServer: [DUBBO] Start NettyServer bind /0.0.0.0:8082, export /172.16.1.252:8082, dubbo version: 2.7.8, current host: 172.16.1.252 2021-12-13 18:59:23.097 INFO 5196 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2021-12-13 18:59:23.108 ERROR 5196 --- [ main] o.s.boot.SpringApplication : Application run failed

java.lang.IllegalStateException: No such extension org.apache.dubbo.registry.RegistryFactory by name https at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:623) ~[dubbo-common-2.7.8.jar:2.7.8] at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:630) ~[dubbo-common-2.7.8.jar:2.7.8] at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:429) ~[dubbo-common-2.7.8.jar:2.7.8] at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:413) ~[dubbo-common-2.7.8.jar:2.7.8] at org.apache.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java) ~[dubbo-common-2.7.8.jar:2.7.8] at org.apache.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:354) ~[dubbo-registry-api-2.7.8.jar:2.7.8] at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:208) ~[dubbo-registry-api-2.7.8.jar:2.7.8] at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:62) ~[dubbo-rpc-api-2.7.8.jar:2.7.8] at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:153) ~[dubbo-rpc-api-2.7.8.jar:2.7.8] at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-common-2.7.8.jar:2.7.8] at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:492) ~[dubbo-config-api-2.7.8.jar:2.7.8] at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:325) ~[dubbo-config-api-2.7.8.jar:2.7.8] at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:300) ~[dubbo-config-api-2.7.8.jar:2.7.8] at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:206) ~[dubbo-config-api-2.7.8.jar:2.7.8] at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$15(DubboBootstrap.java:1103) ~[dubbo-config-api-2.7.8.jar:2.7.8] at java.base/java.util.HashMap$Values.forEach(HashMap.java:976) ~[na:na] at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:1090) ~[dubbo-config-api-2.7.8.jar:2.7.8] at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:901) ~[dubbo-config-api-2.7.8.jar:2.7.8] at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:59) ~[dubbo-config-spring-2.7.8.jar:2.7.8] at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:52) ~[dubbo-config-spring-2.7.8.jar:2.7.8] at org.apache.dubbo.config.spring.context.OneTimeExecutionApplicationContextEventListener.onApplicationEvent(OneTimeExecutionApplicationContextEventListener.java:40) ~[dubbo-config-spring-2.7.8.jar:2.7.8] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:898) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE] at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE] at com.huaweicloud.samples.basic.ProviderApplication.main(ProviderApplication.java:30) ~[classes/:na]

[13/12/21 18:59:23:111 CST] main INFO support.AbstractRegistryFactory: [DUBBO] Close all registries [], dubbo version: 2.7.8, current host: 172.16.1.252 [13/12/21 18:59:23:111 CST] main INFO dubbo.DubboProtocol: [DUBBO] Close dubbo server: /172.16.1.252:8082

liubao68 commented 2 years ago

是不是下面的配置项漏了?

#### enabled SSL  ####
dubbo.servicecomb.ssl.enabled=true
wanlinxiang commented 2 years ago

配置使用了这个参数,仍然在代码中报这个错误

wanlinxiang commented 2 years ago

1640076884(1)

liubao68 commented 2 years ago

感觉是bean配置文件写错了。 问题已经解决了吗?

zhaozw commented 2 years ago

这个我测试了一下,把dubbo-consumer.xml里面的

改成

会导致上面的问题,因为咱们只针对sc做了扩展 sc=com.huaweicloud.dubbo.discovery.ServiceCenterRegistryFactory 这里是不是只改dubbo.properties dubbo.servicecomb.registry.address=http://127.0.0.1:30100 dubbo.servicecomb.config.address=http://127.0.0.1:30110 上面的改成https就可以? dubbo:registry的sc协议不要改,只需要改后面的IP和端口?

liubao68 commented 2 years ago

@zhaozw 是的