<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.4</li>
<li>Operating System version: win10</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/57934445/71306583-316b7980-241d-11ea-9316-6f713b3d898d.png"><img src="https://user-images.githubusercontent.com/57934445/71306583-316b7980-241d-11ea-9316-6f713b3d898d.png" alt="image" style="max-width: 100%;"></a><br>
Spring boot version 2.2.2.release integration Dubbo version 2.7.4 is started by XML configuration, as shown in the figure above, if the configuration commented out is turned on, it will start normally, if the configuration commented out is turned off, the position shown in the figure below will have a null pointer problem:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/57934445/71306605-77c0d880-241d-11ea-8b1b-70d6411acbfb.png"><img src="https://user-images.githubusercontent.com/57934445/71306605-77c0d880-241d-11ea-8b1b-70d6411acbfb.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Startup success</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Start failed with null pointer</p>
<p dir="auto">Just put your stack trace here!</p>
<p dir="auto">java.lang.NullPointerException: null<br>
at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$null$7(AbstractInterfaceConfig.java:628) ~[dubbo-2.7.4.jar:2.7.4]<br>
at java.util.Optional.orElseGet(Optional.java:267) ~[na:1.8.0_211]<br>
at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$useRegistryForConfigIfNecessary$8(AbstractInterfaceConfig.java:620) ~[dubbo-2.7.4.jar:2.7.4]<br>
at java.util.Optional.ifPresent(Optional.java:159) ~[na:1.8.0_211]<br>
at org.apache.dubbo.config.AbstractInterfaceConfig.useRegistryForConfigIfNecessary(AbstractInterfaceConfig.java:618) ~[dubbo-2.7.4.jar:2.7.4]<br>
at org.apache.dubbo.config.AbstractInterfaceConfig.checkRegistry(AbstractInterfaceConfig.java:208) ~[dubbo-2.7.4.jar:2.7.4]<br>
at org.apache.dubbo.config.ServiceConfig.checkAndUpdateSubConfigs(ServiceConfig.java:303) ~[dubbo-2.7.4.jar:2.7.4]<br>
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:370) ~[dubbo-2.7.4.jar:2.7.4]<br>
at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:336) ~[dubbo-2.7.4.jar:2.7.4]<br>
at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:114) ~[dubbo-2.7.4.jar:2.7.4]<br>
at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:60) ~[dubbo-2.7.4.jar:2.7.4]<br>
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]<br>
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]<br>
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]<br>
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]<br>
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]<br>
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:897) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]<br>
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]<br>
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]<br>
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]<br>
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]<br>
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]<br>
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]<br>
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]<br>
at com.bigboss.provider.AplicationRunner.main(AplicationRunner.java:22) [classes/:na]</p>
<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/incubator-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/incubator-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.6.2</li>
<li>Operating System version: window 7</li>
<li>Java version: java7</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>启动一个服务provider，分组为sg</li>
<li>启动相同的服务provider，分组为cf</li>
<li>启动consumer，分组设置为*，无限循环调用服务。<br>
4.consumer调用时，从provider列表会取第一个provider进行调用。<br>
5.当用admin控制台将第一个provider禁用后，仍然调用第一个consumer</li>
</ol>