<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.6</li>
<li>Operating System version: Mac 10.15</li>
<li>Java version: 11<br>
registry:nacos 1.2.0</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>在停应用时，出现以下错误</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="2020-04-17 17:53:01.735  INFO 41463  DubboShutdownHook o.a.d.r.n.NacosRegistry :  [DUBBO] Destroy unsubscribe url consumer://169.254.202.113/org.apache.dubbo.rpc.service.GenericService?application=dubbo-admin-gateway&amp;category=providers,configurators,routers&amp;check=false&amp;connections=0&amp;dubbo=2.0.2&amp;generic=true&amp;interface=com.bw.api.UiPageTableService&amp;pid=41463&amp;qos.enable=false&amp;qos.port=22222&amp;release=2.7.6&amp;retries=0&amp;side=consumer&amp;sticky=false&amp;timeout=32000&amp;timestamp=1587116295070&amp;version=1.0.0, dubbo version: 2.7.6, current host: 169.254.202.113
Exception in thread &quot;DubboShutdownHook&quot; java.lang.RuntimeException: java.util.ConcurrentModificationException
	at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:48)
	at org.apache.dubbo.common.lang.ShutdownHookCallbacks.lambda$callback$0(ShutdownHookCallbacks.java:70)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.apache.dubbo.common.lang.ShutdownHookCallbacks.callback(ShutdownHookCallbacks.java:70)
	at org.apache.dubbo.config.DubboShutdownHook.callback(DubboShutdownHook.java:85)
	at org.apache.dubbo.config.DubboShutdownHook.run(DubboShutdownHook.java:73)
Caused by: java.util.ConcurrentModificationException
	at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1493)
	at java.base/java.util.HashMap$ValueIterator.next(HashMap.java:1521)
	at java.base/java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1047)
	at org.apache.dubbo.registry.support.AbstractRegistryFactory.destroyAll(AbstractRegistryFactory.java:85)
	at org.apache.dubbo.config.DubboShutdownHook.destroyAll(DubboShutdownHook.java:128)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.destroy(DubboBootstrap.java:1039)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap$1.callback(DubboBootstrap.java:191)
	at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:46)
	... 5 more
^C2020-04-17 17:53:02.036  INFO 41463  SpringContextShutdownHook c.a.c.n.r.NacosServiceRegistry : De-registering from Nacos Server now...
2020-04-17 17:53:02.041  INFO 41463  SpringContextShutdownHook c.a.c.n.r.NacosServiceRegistry : De-registration finished.
"><pre class="notranslate"><code class="notranslate">2020-04-17 17:53:01.735  INFO 41463  DubboShutdownHook o.a.d.r.n.NacosRegistry :  [DUBBO] Destroy unsubscribe url consumer://169.254.202.113/org.apache.dubbo.rpc.service.GenericService?application=dubbo-admin-gateway&amp;category=providers,configurators,routers&amp;check=false&amp;connections=0&amp;dubbo=2.0.2&amp;generic=true&amp;interface=com.bw.api.UiPageTableService&amp;pid=41463&amp;qos.enable=false&amp;qos.port=22222&amp;release=2.7.6&amp;retries=0&amp;side=consumer&amp;sticky=false&amp;timeout=32000&amp;timestamp=1587116295070&amp;version=1.0.0, dubbo version: 2.7.6, current host: 169.254.202.113
Exception in thread "DubboShutdownHook" java.lang.RuntimeException: java.util.ConcurrentModificationException
	at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:48)
	at org.apache.dubbo.common.lang.ShutdownHookCallbacks.lambda$callback$0(ShutdownHookCallbacks.java:70)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.apache.dubbo.common.lang.ShutdownHookCallbacks.callback(ShutdownHookCallbacks.java:70)
	at org.apache.dubbo.config.DubboShutdownHook.callback(DubboShutdownHook.java:85)
	at org.apache.dubbo.config.DubboShutdownHook.run(DubboShutdownHook.java:73)
Caused by: java.util.ConcurrentModificationException
	at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1493)
	at java.base/java.util.HashMap$ValueIterator.next(HashMap.java:1521)
	at java.base/java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1047)
	at org.apache.dubbo.registry.support.AbstractRegistryFactory.destroyAll(AbstractRegistryFactory.java:85)
	at org.apache.dubbo.config.DubboShutdownHook.destroyAll(DubboShutdownHook.java:128)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.destroy(DubboBootstrap.java:1039)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap$1.callback(DubboBootstrap.java:191)
	at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:46)
	... 5 more
^C2020-04-17 17:53:02.036  INFO 41463  SpringContextShutdownHook c.a.c.n.r.NacosServiceRegistry : De-registering from Nacos Server now...
2020-04-17 17:53:02.041  INFO 41463  SpringContextShutdownHook c.a.c.n.r.NacosServiceRegistry : De-registration finished.

</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/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.7.0</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>Interface without package.</li>
</ol>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1424920/53320488-ca6e5880-3910-11e9-9493-e074ff1f91a7.png"><img src="https://user-images.githubusercontent.com/1424920/53320488-ca6e5880-3910-11e9-9493-e074ff1f91a7.png" alt="image" style="max-width: 100%;"></a></p>
<ol start="2" dir="auto">
<li>Export service.</li>
</ol>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="serviceConfig.setInterface(HelloService.class.getName());
serviceConfig.setRef(new HelloServiceImpl());"><pre class="notranslate"><span class="pl-s1">serviceConfig</span>.<span class="pl-en">setInterface</span>(<span class="pl-smi">HelloService</span>.<span class="pl-k">class</span>.<span class="pl-en">getName</span>());
<span class="pl-s1">serviceConfig</span>.<span class="pl-en">setRef</span>(<span class="pl-k">new</span> <span class="pl-smi">HelloServiceImpl</span>());</pre></div>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Export service.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Catch NPE when export service.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="java.lang.NullPointerException
	at com.alibaba.dubbo.common.Version.getVersion(Version.java:127)
	at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:440)
	at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:358)
	at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:317)"><pre class="notranslate"><code class="notranslate">java.lang.NullPointerException
	at com.alibaba.dubbo.common.Version.getVersion(Version.java:127)
	at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:440)
	at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:358)
	at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:317)
</code></pre></div>