<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: xxx</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>xxx</li>
<li>xxx</li>
<li>xxx</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<p dir="auto">Dubbo version: 2.7.5<br>
Operating System version: Mac OS 10.15.2<br>
Java version: 1.8.0_231</p>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>启动基础环境 和 provider服务，步骤同 <a href="https://github.com/apache/dubbo/issues/5625" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/5625/hovercard">issue 5625</a></li>
<li>启动consumer服务</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<ul dir="auto">
<li>
<p dir="auto">consumer启动成功，无报错信息</p>
</li>
<li>
<p dir="auto">consumer能够被访问，并正确地收到provider返回的数据</p>
</li>
</ul>
<h3 dir="auto">Actual Result</h3>
<ul dir="auto">
<li>consumer启动失败，日志报错</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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]"><pre class="notranslate"><code class="notranslate">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]
</code></pre></div>
<ul dir="auto">
<li>consumer访问失败，找不到服务</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2261374/72124498-f74c2280-339f-11ea-984e-1fb86272a8fc.png"><img src="https://user-images.githubusercontent.com/2261374/72124498-f74c2280-339f-11ea-984e-1fb86272a8fc.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">相关代码和配置</h3>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="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 = &quot;1.0.0&quot;, timeout = 5000, check = false)
    private DubboGreeterGrpc.IGreeter greeter;

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

}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">org</span>.<span class="pl-s1">apache</span>.<span class="pl-s1">dubbo</span>.<span class="pl-s1">config</span>.<span class="pl-s1">annotation</span>.<span class="pl-s1">Reference</span>;
<span class="pl-k">import</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">web</span>.<span class="pl-s1">bind</span>.<span class="pl-s1">annotation</span>.<span class="pl-s1">RequestMapping</span>;
<span class="pl-k">import</span> <span class="pl-s1">org</span>.<span class="pl-s1">springframework</span>.<span class="pl-s1">web</span>.<span class="pl-s1">bind</span>.<span class="pl-s1">annotation</span>.<span class="pl-s1">RestController</span>;
<span class="pl-k">import</span> <span class="pl-s1">testproto</span>.<span class="pl-s1">DubboGreeterGrpc</span>;
<span class="pl-k">import</span> <span class="pl-s1">testproto</span>.<span class="pl-s1">HelloReply</span>;
<span class="pl-k">import</span> <span class="pl-s1">testproto</span>.<span class="pl-s1">HelloRequest</span>;

<span class="pl-c1">@</span><span class="pl-c1">RestController</span>
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">TestController</span> {

    <span class="pl-c1">@</span><span class="pl-c1">Reference</span>(<span class="pl-s1">version</span> = <span class="pl-s">"1.0.0"</span>, <span class="pl-s1">timeout</span> = <span class="pl-c1">5000</span>, <span class="pl-s1">check</span> = <span class="pl-c1">false</span>)
    <span class="pl-k">private</span> <span class="pl-smi">DubboGreeterGrpc</span>.<span class="pl-smi">IGreeter</span> <span class="pl-s1">greeter</span>;

    <span class="pl-c1">@</span><span class="pl-c1">RequestMapping</span>(<span class="pl-s">"/"</span>)
    <span class="pl-k">public</span> <span class="pl-smi">String</span> <span class="pl-en">test</span>() {
        <span class="pl-smi">HelloRequest</span> <span class="pl-s1">request</span> = <span class="pl-smi">HelloRequest</span>.<span class="pl-en">newBuilder</span>()
                .<span class="pl-en">setName</span>(<span class="pl-s">"test: "</span> + <span class="pl-smi">System</span>.<span class="pl-en">currentTimeMillis</span>())
                .<span class="pl-en">build</span>();
        <span class="pl-smi">HelloReply</span> <span class="pl-s1">reply</span> = <span class="pl-s1">greeter</span>.<span class="pl-en">sayHello</span>(<span class="pl-s1">request</span>);
        <span class="pl-k">return</span> <span class="pl-s1">reply</span>.<span class="pl-en">getMessage</span>();
    }

}</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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"><pre class="notranslate"><code class="notranslate">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
</code></pre></div>