apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.51k stars 26.43k forks source link

将dubbo-demo-spring-boot-provider改为使用nacos注册中心,部署到EDAS中,应用启动失败 #10860

Closed nihongye closed 2 years ago

nihongye commented 2 years ago

Environment

Steps to reproduce this issue

  1. 使用dubbo-demo/dubbo-demo-spring-boot/dubbo-demo-spring-boot-provider,详细见附件,demo上的修改如下 添加依赖
    <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-registry-nacos</artifactId>
        </dependency>

    修改application.yml,去掉zk配置,指定nacos registry配置如下

    registry:
    id: nacos-registry
    address: nacos://127.0.0.1:8848
    config-center:
    address: nacos://127.0.0.1:8848
    metadata-report:
    address: nacos://127.0.0.1:8848

    3.将应用部署到EDAS中

  2. 应用启动报错

Pls. provide [GitHub address] to reproduce this issue.

应用正常启动发布服务

应用启动失败,不能注册服务

If there is an exception, please attach the exception trace:

java.lang.RuntimeException: Can not create registry service-discovery-registry://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?REGISTRY_CLUSTER=nacos-registry&application=dubbo-springboot-demo-provider&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&mse.project.name=73dfbb59-734f-4ef1-a34d-d962fc00c58c&pid=49&qos.enable=false&registry=nacos&release=3.0.9
        at org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:92) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.RegistryFactoryWrapper.getRegistry(RegistryFactoryWrapper.java:33) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:393) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:242) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:64) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:74) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:58) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.ServiceConfig.doExportUrl(ServiceConfig.java:641) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.ServiceConfig.exportRemote(ServiceConfig.java:619) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.ServiceConfig.exportUrl(ServiceConfig.java:578) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:410) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:396) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:361) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:233) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:341) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:313) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:145) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:111) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:100) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:45) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.20.RELEASE.jar!/:5.2.20.RELEASE]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.20.RELEASE.jar!/:5.2.20.RELEASE]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.20.RELEASE.jar!/:5.2.20.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404) ~[spring-context-5.2.20.RELEASE.jar!/:5.2.20.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361) ~[spring-context-5.2.20.RELEASE.jar!/:5.2.20.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:898) ~[spring-context-5.2.20.RELEASE.jar!/:5.2.20.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554) ~[spring-context-5.2.20.RELEASE.jar!/:5.2.20.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
        at org.apache.dubbo.springboot.demo.provider.ProviderApplication.main(ProviderApplication.java:31) [classes!/:3.0.9]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [dubbo-demo-spring-boot-provider-3.0.9.jar:3.0.9]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [dubbo-demo-spring-boot-provider-3.0.9.jar:3.0.9]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [dubbo-demo-spring-boot-provider-3.0.9.jar:3.0.9]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [dubbo-demo-spring-boot-provider-3.0.9.jar:3.0.9]
Caused by: java.lang.IllegalStateException: ErrCode:-400, ErrMsg:serverList is empty,please check configuration
        at org.apache.dubbo.registry.nacos.util.NacosNamingServiceUtils.createNamingService(NacosNamingServiceUtils.java:109) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.nacos.NacosServiceDiscovery.<init>(NacosServiceDiscovery.java:60) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.nacos.NacosServiceDiscoveryFactory.createDiscovery(NacosServiceDiscoveryFactory.java:27) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.client.AbstractServiceDiscoveryFactory.lambda$getServiceDiscovery$0(AbstractServiceDiscoveryFactory.java:53) ~[dubbo-3.0.9.jar!/:3.0.9]
        at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_191]
        at org.apache.dubbo.registry.client.AbstractServiceDiscoveryFactory.getServiceDiscovery(AbstractServiceDiscoveryFactory.java:53) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.getServiceDiscovery(ServiceDiscoveryRegistry.java:122) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.createServiceDiscovery(ServiceDiscoveryRegistry.java:109) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.<init>(ServiceDiscoveryRegistry.java:86) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryFactory.createRegistry(ServiceDiscoveryRegistryFactory.java:35) ~[dubbo-3.0.9.jar!/:3.0.9]
        at org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:89) ~[dubbo-3.0.9.jar!/:3.0.9]
        ... 44 common frames omitted
Caused by: com.alibaba.nacos.api.exception.NacosException: java.lang.reflect.InvocationTargetException
        at com.alibaba.nacos.api.naming.NamingFactory.createNamingService(NamingFactory.java:61) ~[nacos-client-2.1.0.jar!/:na]
        at com.alibaba.nacos.api.NacosFactory.createNamingService(NacosFactory.java:77) ~[nacos-client-2.1.0.jar!/:na]
        at org.apache.dubbo.registry.nacos.util.NacosNamingServiceUtils.createNamingService(NacosNamingServiceUtils.java:104) ~[dubbo-3.0.9.jar!/:3.0.9]
        ... 54 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_191]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_191]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_191]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_191]
        at com.alibaba.nacos.api.naming.NamingFactory.createNamingService(NamingFactory.java:59) ~[nacos-client-2.1.0.jar!/:na]
        ... 56 common frames omitted
Caused by: com.alibaba.nacos.api.exception.runtime.NacosLoadException: serverList is empty,please check configuration
        at com.alibaba.nacos.client.naming.core.ServerListManager.<init>(ServerListManager.java:91) ~[nacos-client-2.1.0.jar!/:na]
        at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.<init>(NamingClientProxyDelegate.java:70) ~[nacos-client-2.1.0.jar!/:na]
        at com.alibaba.nacos.client.naming.Nacos
[dubbo-demo-spring-boot-provider.tar.gz](https://github.com/apache/dubbo/files/9900078/dubbo-demo-spring-boot-provider.tar.gz)
NamingService.init(NacosNamingService.java:95) ~[nacos-client-2.1.0.jar!/:na]
        at com.alibaba.nacos.client.naming.NacosNamingService.<init>(NacosNamingService.java:81) ~[nacos-client-2.1.0.jar!/:na]
        ... 61 common frames omitted
[dubbo-demo-spring-boot-provider.tar.gz](https://github.com/apache/dubbo/files/9900055/dubbo-demo-spring-boot-provider.tar.gz)
[dubbo-demo-spring-boot-provider.tar.gz](https://github.com/apache/dubbo/files/9900066/dubbo-demo-spring-boot-provider.tar.gz)
AlbumenJ commented 2 years ago
Caused by: com.alibaba.nacos.api.exception.runtime.NacosLoadException: serverList is empty,please check configuration

This might be a issue of https://github.com/alibaba/nacos