<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.1</li>
<li>Operating System version: win10</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>config dubbo.provider.group=xxx or dubbo.provider.version=x.x.x</li>
<li>export providers as rest protocol</li>
<li>startup application will NPE</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？<br>
fine</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?<br>
NPE</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="java.lang.NullPointerException: null
	at org.apache.dubbo.rpc.protocol.rest.RestProtocol.doExport(RestProtocol.java:99) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.AbstractProxyProtocol.export(AbstractProxyProtocol.java:78) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:63) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:61) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:122) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$2(RegistryProtocol.java:245) ~[dubbo-2.7.3.jar:2.7.3]
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_102]
	at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:243) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:209) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:61) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:59) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:120) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:607) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:457) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:415) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:378) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:336) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:114) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:60) ~[dubbo-2.7.3.jar:2.7.3]"><pre class="notranslate"><code class="notranslate">java.lang.NullPointerException: null
	at org.apache.dubbo.rpc.protocol.rest.RestProtocol.doExport(RestProtocol.java:99) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.AbstractProxyProtocol.export(AbstractProxyProtocol.java:78) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:63) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:61) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:122) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$2(RegistryProtocol.java:245) ~[dubbo-2.7.3.jar:2.7.3]
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_102]
	at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:243) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:209) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:61) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:59) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:120) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:607) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:457) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:415) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:378) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:336) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:114) ~[dubbo-2.7.3.jar:2.7.3]
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:60) ~[dubbo-2.7.3.jar:2.7.3]
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/21060863/67087831-4dad2900-f1d6-11e9-8b8c-1fe41e452224.png"><img src="https://user-images.githubusercontent.com/21060863/67087831-4dad2900-f1d6-11e9-8b8c-1fe41e452224.png" alt="image" style="max-width: 100%;"></a><br>
发生这个问题的主要原因是当使用dubbo.provider/consumer指定分组/版本信息时候，分组/版本等default元数据没正确的存入到ApplicationModel中。</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/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: Win7</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>Generic invoke</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ApplicationConfig application = new ApplicationConfig();
application.setName(&quot;api-generic-consumer&quot;);
ReferenceConfig&lt;GenericService&gt; reference = new ReferenceConfig&lt;&gt;();
reference.setUrl(&quot;dubbo://ip:port/com.xxx.XXXService&quot;);
reference.setVersion(&quot;1.0.0&quot;);
reference.setGeneric(true);
reference.setApplication(application);
reference.setInterface(&quot;com.xxx.XXXService&quot;);
GenericService genericService = reference.get();
Object obj = genericService.$invoke(&quot;getYYY&quot;, new String[]{Long.class.getName()}, new Long[]{1L});
String json = JsonUtils.toJson(obj);
System.out.println(json);"><pre class="notranslate"><code class="notranslate">ApplicationConfig application = new ApplicationConfig();
application.setName("api-generic-consumer");
ReferenceConfig&lt;GenericService&gt; reference = new ReferenceConfig&lt;&gt;();
reference.setUrl("dubbo://ip:port/com.xxx.XXXService");
reference.setVersion("1.0.0");
reference.setGeneric(true);
reference.setApplication(application);
reference.setInterface("com.xxx.XXXService");
GenericService genericService = reference.get();
Object obj = genericService.$invoke("getYYY", new String[]{Long.class.getName()}, new Long[]{1L});
String json = JsonUtils.toJson(obj);
System.out.println(json);
</code></pre></div>
<ol start="2" dir="auto">
<li>ReferenceConfig.init() -&gt; ReferenceConfig.createProxy() -&gt; ClusterUtils.mergeUrl(), Lost after passing 'ClusterUtils.mergeUrl'.</li>
</ol>
<p dir="auto">ps. Dubbo v2.7.2 previous version verified that it will not be lost.</p>
<h3 dir="auto">Screen</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3387548/63311381-775de700-c330-11e9-9915-4a64d259886b.png"><img src="https://user-images.githubusercontent.com/3387548/63311381-775de700-c330-11e9-9915-4a64d259886b.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3387548/63311401-86449980-c330-11e9-91eb-1a39ea300a2d.png"><img src="https://user-images.githubusercontent.com/3387548/63311401-86449980-c330-11e9-91eb-1a39ea300a2d.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Get the interface return value normally.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Consumer:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="com.alibaba.dubbo.remoting.RemotingException: Not found exported service: com.jiuyescm.account.api.IUserService:20834 in [com.jiuyescm.account.api.IPassportService:1.0.0:20834, com.jiuyescm.account.api.ILoginStrategyService:1.0.0:20834, com.jiuyescm.account.api.ILogService:1.0.0:20834, com.jiuyescm.account.api.IUserService:1.0.0:20834], may be version or group mismatch , channel: consumer: /192.168.56.1:59260 --&gt; provider: /192.168.56.1:20834, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=[getYYY, [Ljava.lang.String;@54e64fa4, [Ljava.lang.Object;@5a21bb48], attachments={path=com.xxx.XXXService, input=309, dubbo=2.0.2, interface=com.xxx.XXXService, version=0.0.0, generic=true}]"><pre class="notranslate"><code class="notranslate">com.alibaba.dubbo.remoting.RemotingException: Not found exported service: com.jiuyescm.account.api.IUserService:20834 in [com.jiuyescm.account.api.IPassportService:1.0.0:20834, com.jiuyescm.account.api.ILoginStrategyService:1.0.0:20834, com.jiuyescm.account.api.ILogService:1.0.0:20834, com.jiuyescm.account.api.IUserService:1.0.0:20834], may be version or group mismatch , channel: consumer: /192.168.56.1:59260 --&gt; provider: /192.168.56.1:20834, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=[getYYY, [Ljava.lang.String;@54e64fa4, [Ljava.lang.Object;@5a21bb48], attachments={path=com.xxx.XXXService, input=309, dubbo=2.0.2, interface=com.xxx.XXXService, version=0.0.0, generic=true}]
</code></pre></div>
<p dir="auto">Provider:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2019-08-20 09:59:42.456 [New I/O worker #7] INFO com.alibaba.dubbo.common.logger.log4j.Log4jLogger.info(Log4jLogger.java:66) -  [DUBBO] Not found exported service: com.xxx.XXXService:20834 in [com.xxx.AAAService:1.0.0:20834, com.xxx.BBBService:1.0.0:20834, com.xxx.CCC:1.0.0:20834, com.xxx.XXXService:1.0.0:20834], may be version or group mismatch , channel: consumer: /192.168.56.1:59260 --&gt; provider: /192.168.56.1:20834, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=null, attachments={path=com.xxx.XXXService, dubbo=2.0.2, interface=com.xxx.XXXService, version=0.0.0, generic=true}], dubbo version: 2.5.3, current host: 192.168.56.1 #-# com.alibaba.dubbo.remoting.RemotingException: Not found exported service: com.xxx.XXXService:20834 in [com.xxx.IPassportService:1.0.0:20834, com.xxx.ILoginStrategyService:1.0.0:20834, com.xxx.ILogService:1.0.0:20834, com.xxx.XXXService:1.0.0:20834], may be version or group mismatch , channel: consumer: /192.168.56.1:59260 --&gt; provider: /192.168.56.1:20834, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=null, attachments={path=com.xxx.XXXService, dubbo=2.0.2, interface=com.xxx.XXXService, version=0.0.0, generic=true}]"><pre class="notranslate"><code class="notranslate">2019-08-20 09:59:42.456 [New I/O worker #7] INFO com.alibaba.dubbo.common.logger.log4j.Log4jLogger.info(Log4jLogger.java:66) -  [DUBBO] Not found exported service: com.xxx.XXXService:20834 in [com.xxx.AAAService:1.0.0:20834, com.xxx.BBBService:1.0.0:20834, com.xxx.CCC:1.0.0:20834, com.xxx.XXXService:1.0.0:20834], may be version or group mismatch , channel: consumer: /192.168.56.1:59260 --&gt; provider: /192.168.56.1:20834, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=null, attachments={path=com.xxx.XXXService, dubbo=2.0.2, interface=com.xxx.XXXService, version=0.0.0, generic=true}], dubbo version: 2.5.3, current host: 192.168.56.1 #-# com.alibaba.dubbo.remoting.RemotingException: Not found exported service: com.xxx.XXXService:20834 in [com.xxx.IPassportService:1.0.0:20834, com.xxx.ILoginStrategyService:1.0.0:20834, com.xxx.ILogService:1.0.0:20834, com.xxx.XXXService:1.0.0:20834], may be version or group mismatch , channel: consumer: /192.168.56.1:59260 --&gt; provider: /192.168.56.1:20834, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=null, attachments={path=com.xxx.XXXService, dubbo=2.0.2, interface=com.xxx.XXXService, version=0.0.0, generic=true}]
</code></pre></div>