Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: xxx

Operating System version: xxx

Java version: xxx

Steps to reproduce this issue

xxx

xxx

xxx

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

Expected Result

What do you expected from the above steps？

Actual Result

What actually happens?

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

Just put your stack trace here!

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.5

Operating System version: Mac OS 10.15.2

Java version: 1.8.0_231

Steps to reproduce this issue

启动基础环境 和 provider服务，步骤同 issue 5625

启动consumer服务

Expected Result

consumer启动成功，无报错信息

consumer能够被访问，并正确地收到provider返回的数据

Actual Result

consumer启动失败，日志报错

2020-01-10 10:08:01.416 WARN 20243 --- [ main] m.DynamicConfigurationServiceNameMapping : [DUBBO] null, dubbo version: 2.7.5, current host: ***

java.lang.NullPointerException: null
at java.util.TreeMap.compare(TreeMap.java:1294) ~[na:1.8.0_231]
at java.util.TreeMap.put(TreeMap.java:538) ~[na:1.8.0_231]
at java.util.TreeSet.add(TreeSet.java:255) ~[na:1.8.0_231]
at org.apache.dubbo.configcenter.support.etcd.EtcdDynamicConfiguration.getConfigKeys(EtcdDynamicConfiguration.java:128) ~[classes/:2.7.5]
at org.apache.dubbo.common.config.configcenter.wrapper.CompositeDynamicConfiguration.lambda$getConfigKeys$5(CompositeDynamicConfiguration.java:82) ~[dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.common.config.configcenter.wrapper.CompositeDynamicConfiguration.iterateConfigOperation(CompositeDynamicConfiguration.java:94) ~[dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.common.config.configcenter.wrapper.CompositeDynamicConfiguration.getConfigKeys(CompositeDynamicConfiguration.java:82) ~[dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.metadata.DynamicConfigurationServiceNameMapping.lambda$get$1(DynamicConfigurationServiceNameMapping.java:74) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.metadata.DynamicConfigurationServiceNameMapping.execute(DynamicConfigurationServiceNameMapping.java:92) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.metadata.DynamicConfigurationServiceNameMapping.get(DynamicConfigurationServiceNameMapping.java:73) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.findMappedServices(ServiceDiscoveryRegistry.java:854) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.getServices(ServiceDiscoveryRegistry.java:818) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribeURLs(ServiceDiscoveryRegistry.java:328) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.doSubscribe(ServiceDiscoveryRegistry.java:294) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:299) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribe(ServiceDiscoveryRegistry.java:289) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:105) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:174) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:415) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:396) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:151) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:70) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:73) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:324) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:266) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:151) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.getOrCreateProxy(ReferenceAnnotationBeanPostProcessor.java:249) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:142) [dubbo-2.7.5.jar:2.7.5]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.getInjectedObject(AbstractAnnotationBeanPostProcessor.java:358) [spring-context-support-1.0.5.jar:na]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedFieldElement.inject(AbstractAnnotationBeanPostProcessor.java:538) [spring-context-support-1.0.5.jar:na]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:141) [spring-context-support-1.0.5.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) [spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) [spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
......

java.lang.IllegalStateException: Should has at least one way to know which services this interface belongs to, subscription url: ......
at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribeURLs(ServiceDiscoveryRegistry.java:330) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.doSubscribe(ServiceDiscoveryRegistry.java:294) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:299) ~[dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribe(ServiceDiscoveryRegistry.java:289) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:105) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:174) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:415) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:396) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:151) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:70) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:73) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:324) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:266) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:151) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.getOrCreateProxy(ReferenceAnnotationBeanPostProcessor.java:249) [dubbo-2.7.5.jar:2.7.5]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:142) [dubbo-2.7.5.jar:2.7.5]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.getInjectedObject(AbstractAnnotationBeanPostProcessor.java:358) [spring-context-support-1.0.5.jar:na]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedFieldElement.inject(AbstractAnnotationBeanPostProcessor.java:538) [spring-context-support-1.0.5.jar:na]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:141) [spring-context-support-1.0.5.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) [spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) [spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]

consumer访问失败，找不到服务

相关代码和配置

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import testproto.DubboGreeterGrpc;
import testproto.HelloReply;
import testproto.HelloRequest;

@RestController
public class TestController {

@Reference(version = "1.0.0", timeout = 5000, check = false)
private DubboGreeterGrpc.IGreeter greeter;

@RequestMapping("/")
public String test() {
HelloRequest request = HelloRequest.newBuilder()
.setName("test: " + System.currentTimeMillis())
.build();
HelloReply reply = greeter.sayHello(request);
return reply.getMessage();
}

}

spring.application.name=dubbo-consumer
server.port=8081
dubbo.application.name=${spring.application.name}
dubbo.application.metadata=remote
dubbo.protocol.name=grpc
dubbo.protocol.port=8889
dubbo.registry.address=etcd3://127.0.0.1:2379?registry-type=service
dubbo.provider.threads=10
dubbo.provider.threadpool=fixed
dubbo.provider.loadbalance=roundrobin
dubbo.metadata-report.address=etcd://127.0.0.1:2379
dubbo.config-center.address=etcd://127.0.0.1:2379