<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: 2.7.3 and 2.7.2</li>
<li>Operating System version: Windows 10</li>
<li>Java version: 1.8.0_151</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol start="0" dir="auto">
<li>pom:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;dependency&gt;
        &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
        &lt;artifactId&gt;spring-cloud-alibaba-dependencies&lt;/artifactId&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;org.apache.dubbo&lt;/groupId&gt;
            &lt;artifactId&gt;dubbo&lt;/artifactId&gt;&lt;/exclusion&gt;
        &lt;/exclusions&gt;
        &lt;version&gt;0.9.0.RELEASE&lt;/version&gt;
        &lt;type&gt;pom&lt;/type&gt;
        &lt;scope&gt;import&lt;/scope&gt;
      &lt;/dependency&gt;

      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.dubbo&lt;/groupId&gt;
        &lt;artifactId&gt;dubbo&lt;/artifactId&gt;
        &lt;version&gt;2.7.3&lt;/version&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
            &lt;artifactId&gt;spring&lt;/artifactId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
            &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;log4j&lt;/groupId&gt;
            &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&gt;
      &lt;/dependency&gt;"><pre class="notranslate"><code class="notranslate">&lt;dependency&gt;
        &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
        &lt;artifactId&gt;spring-cloud-alibaba-dependencies&lt;/artifactId&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;org.apache.dubbo&lt;/groupId&gt;
            &lt;artifactId&gt;dubbo&lt;/artifactId&gt;&lt;/exclusion&gt;
        &lt;/exclusions&gt;
        &lt;version&gt;0.9.0.RELEASE&lt;/version&gt;
        &lt;type&gt;pom&lt;/type&gt;
        &lt;scope&gt;import&lt;/scope&gt;
      &lt;/dependency&gt;

      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.dubbo&lt;/groupId&gt;
        &lt;artifactId&gt;dubbo&lt;/artifactId&gt;
        &lt;version&gt;2.7.3&lt;/version&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
            &lt;artifactId&gt;spring&lt;/artifactId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
            &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;log4j&lt;/groupId&gt;
            &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&gt;
      &lt;/dependency&gt;
</code></pre></div>
<ol dir="auto">
<li>create a configuration class, <strong>without any dubbo properties in local file</strong>.</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@EnableDubbo(scanBasePackages = {&quot;com.xxxx.rpc&quot;})
@Configuration
public class DubboConfig {

    @Bean
    public ConfigCenterConfig configCenterConfig() {
        ConfigCenterConfig configCenterConfig = new ConfigCenterConfig();
        configCenterConfig.setAddress(&quot;apollo.xxxx.com&quot;);
        configCenterConfig.setProtocol(&quot;apollo&quot;);
        configCenterConfig.setNamespace(&quot;dubbo&quot;);
        configCenterConfig.setGroup(null);
        return configCenterConfig;
    }
}"><pre class="notranslate"><code class="notranslate">@EnableDubbo(scanBasePackages = {"com.xxxx.rpc"})
@Configuration
public class DubboConfig {

    @Bean
    public ConfigCenterConfig configCenterConfig() {
        ConfigCenterConfig configCenterConfig = new ConfigCenterConfig();
        configCenterConfig.setAddress("apollo.xxxx.com");
        configCenterConfig.setProtocol("apollo");
        configCenterConfig.setNamespace("dubbo");
        configCenterConfig.setGroup(null);
        return configCenterConfig;
    }
}
</code></pre></div>
<ol start="2" dir="auto">
<li>The RegistryAddress provided in Apollo namespace: dubbo:</li>
</ol>
<p dir="auto">property key: dubbo.properties<br>
property value:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dubbo.application.name=Consumer
dubbo.application.qos-enable=false
dubbo.registry.address=zookeeper://zk.xxxxx.com?backup=zk2.xxxxx.com
dubbo.registry.simplified=true"><pre class="notranslate"><code class="notranslate">dubbo.application.name=Consumer
dubbo.application.qos-enable=false
dubbo.registry.address=zookeeper://zk.xxxxx.com?backup=zk2.xxxxx.com
dubbo.registry.simplified=true
</code></pre></div>
<p dir="auto">as shown in picture:<br>
<a href="http://dubbo.apache.org/img/apollo-configcenter-application.jpg" rel="nofollow">http://dubbo.apache.org/img/apollo-configcenter-application.jpg</a></p>
<p dir="auto">when add <code class="notranslate">dubbo.registry.address=N/A</code> to local properties file，the apollo config is truely resolved. but the problem exception still remain.</p>
<ol start="3" dir="auto">
<li>The consumer code:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Reference(version = &quot;${xxxx.service.version}&quot;, retries = 0, lazy=true)
private IRExecutionService executionService;"><pre class="notranslate"><code class="notranslate">@Reference(version = "${xxxx.service.version}", retries = 0, lazy=true)
private IRExecutionService executionService;
</code></pre></div>
<p dir="auto">I will provide full code to reproduce this issue if it's necessary.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">The <a href="http://dubbo.apache.org/zh-cn/docs/user/configuration/config-center.html" rel="nofollow">document </a>shows ConfigCenterConfig support RegistryConfig.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caused by: java.lang.IllegalStateException: No such any registry to reference com.xxx.yyy.IRExecutionService on the consumer a.b.c.d use dubbo version 2.7.3, please config &lt;dubbo:registry address=&quot;...&quot; /&gt; to your spring config.
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:390) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:329) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:250) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.init(ReferenceAnnotationBeanPostProcessor.java:269) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.access$100(ReferenceAnnotationBeanPostProcessor.java:242) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildInvocationHandler(ReferenceAnnotationBeanPostProcessor.java:236) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildProxy(ReferenceAnnotationBeanPostProcessor.java:219) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:134) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.getInjectedObject(AnnotationInjectedBeanPostProcessor.java:360) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor$AnnotatedFieldElement.inject(AnnotationInjectedBeanPostProcessor.java:540) ~[dubbo-2.7.3.jar:2.7.3]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:147) ~[dubbo-2.7.3.jar:2.7.3]"><pre class="notranslate"><code class="notranslate">Caused by: java.lang.IllegalStateException: No such any registry to reference com.xxx.yyy.IRExecutionService on the consumer a.b.c.d use dubbo version 2.7.3, please config &lt;dubbo:registry address="..." /&gt; to your spring config.
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:390) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:329) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:250) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.init(ReferenceAnnotationBeanPostProcessor.java:269) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.access$100(ReferenceAnnotationBeanPostProcessor.java:242) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildInvocationHandler(ReferenceAnnotationBeanPostProcessor.java:236) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildProxy(ReferenceAnnotationBeanPostProcessor.java:219) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:134) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.getInjectedObject(AnnotationInjectedBeanPostProcessor.java:360) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor$AnnotatedFieldElement.inject(AnnotationInjectedBeanPostProcessor.java:540) ~[dubbo-2.7.3.jar:2.7.3]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:147) ~[dubbo-2.7.3.jar:2.7.3]
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> 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>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version: window</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>配置文件配置</li>
</ol>
<blockquote>
<p dir="auto">nacos.address = 192.168.1.199:8848<br>
nacos.dataId = dubbo-EsMobileClientLauncher-cousumer<br>
nacos.namespace = fd4c2b5d-3649-4558-b85f-50b2f0eb6c4a<br>
dubbo.registry.address = nacos://192.168.1.199:8848?namespace=fd4c2b5d-3649-4558-b85f-50b2f0eb6c4a</p>
</blockquote>
<ol start="2" dir="auto">
<li>启动时启用动态配置中心，服务发现</li>
</ol>
<blockquote>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/SpringBootApplication/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/SpringBootApplication">@SpringBootApplication</a><br>
<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/configuration/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/configuration">@configuration</a><br>
//@EnableCaching<br>
//@EnableSwagger2<br>
@EnableDubbo(scanBasePackages = "com")<br>
@EnableNacosConfig(globalProperties = @NacosProperties(serverAddr = "${nacos.address}",namespace="${nacos.namespace}"))<br>
@EnableNacosDiscovery(globalProperties = @NacosProperties(serverAddr = "${nacos.address}",namespace="${nacos.namespace}"))<br>
@NacosPropertySource(dataId = "${nacos.dataId}",autoRefreshed=true)<br>
public class EsMobileClientLauncherApplication</p>
</blockquote>
<ol start="3" dir="auto">
<li>dubbo-admin控制台配置条件路由</li>
</ol>
<blockquote>
<p dir="auto">conditions:<br>
=&gt; host != 192.168.0.206<br>
enabled: true<br>
force: true<br>
key: com.everstar.mobile.service.INetEventService:1.0.0<br>
priority: 0<br>
runtime: true<br>
scope: service</p>
</blockquote>
<p dir="auto">发现条件路由并没有生效</p>
<ol start="4" dir="auto">
<li>通过debug查看控制台</li>
</ol>
<blockquote>
<p dir="auto">debug了一下，发现<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3623460/66802085-dcf3db80-ef4d-11e9-8327-db2a4dfaf31a.png"><img src="https://user-images.githubusercontent.com/3623460/66802085-dcf3db80-ef4d-11e9-8327-db2a4dfaf31a.png" alt="image" style="max-width: 100%;"></a><br>
使用的NacosRegistry<br>
也订阅了routers<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3623460/66802101-e41ae980-ef4d-11e9-97c6-e5b276ec5ff5.png"><img src="https://user-images.githubusercontent.com/3623460/66802101-e41ae980-ef4d-11e9-97c6-e5b276ec5ff5.png" alt="image" style="max-width: 100%;"></a></p>
</blockquote>
<p dir="auto">日志显示注册完consumers以后，也进行了订阅了，Categories包含了routers</p>
<ol start="5" dir="auto">
<li>
<p dir="auto">查看源码，发现<br>
org.apache.dubbo.registry.zookeeper.ZookeeperRegistry.doSubscribe(URL url, NotifyListener listener)<br>
会循环Categories<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3623460/66802165-20e6e080-ef4e-11e9-86b1-4b83c2df664f.png"><img src="https://user-images.githubusercontent.com/3623460/66802165-20e6e080-ef4e-11e9-86b1-4b83c2df664f.png" alt="image" style="max-width: 100%;"></a><br>
org.apache.dubbo.registry.nacos.NacosRegistry.doSubscribe(URL url, NotifyListener listener, Set serviceNames)<br>
里没有循环Categories<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3623460/66802180-2e03cf80-ef4e-11e9-9aa6-7f246a1e2a60.png"><img src="https://user-images.githubusercontent.com/3623460/66802180-2e03cf80-ef4e-11e9-9aa6-7f246a1e2a60.png" alt="image" style="max-width: 100%;"></a></p>
</li>
<li>
<p dir="auto">更改nacos里的provider服务状态，可以监听到变更，控制台有打印变更的日志<br>
更改nacos里的routers状态，监听不到变更，控制台没有变更的通知</p>
</li>
<li>
<p dir="auto">怀疑NacosRegistry.doSubscribe里没有循环Categories，导致没有订阅routers</p>
</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>