<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"> 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">Steps to reproduce this issue</h3>
<p dir="auto">比如这样配置&lt;dubbo:protocol name="injvm" /&gt; ，会不会配置成功，或者这样配置能暴露一份injvm协议的服务吗？</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.8</li>
<li>Operating System version: macOS Catalina</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">when I regist a <code class="notranslate">Provider</code> Service with version in the form of "default.version" in zookeeper.<br>
And <code class="notranslate">Consumer</code> use dubbo 2.7.8 will fail to find the Provider and will throw Exception as follow</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Consumer can find Provider Service</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Consumer can't find Provider Service and throw Exception as follow</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="No provider available from registry zk01.zeus.likemoon.com:2180 for service com.likemoon.api.rpc.XxxxFacade:1.0.0 on consumer 10.20.11.22 use dubbo version 2.7.8, please check status of providers(disabled, not registered or in blacklist)"><pre class="notranslate"><code class="notranslate">No provider available from registry zk01.zeus.likemoon.com:2180 for service com.likemoon.api.rpc.XxxxFacade:1.0.0 on consumer 10.20.11.22 use dubbo version 2.7.8, please check status of providers(disabled, not registered or in blacklist)
</code></pre></div>
<p dir="auto">as I debug the problem happened in <code class="notranslate">ZookeeperRegistry.toUrlsWithoutEmpty</code> method when using dubbo version &gt;= 2.7.7</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    private List&lt;URL&gt; toUrlsWithoutEmpty(URL consumer, List&lt;String&gt; providers) {
        List&lt;URL&gt; urls = new ArrayList&lt;&gt;();
        if (CollectionUtils.isNotEmpty(providers)) {
            for (String provider : providers) {
                if (provider.contains(PROTOCOL_SEPARATOR_ENCODED)) {
                    //  parseEncodedStr() method can't  parse paramter wieh &quot;default.&quot; prefix
                    URL url = URLStrParser.parseEncodedStr(provider);
                    if (UrlUtils.isMatch(consumer, url)) {
                        urls.add(url);
                    }
                }
            }
        }
        return urls;
    }"><pre class="notranslate">    <span class="pl-k">private</span> <span class="pl-smi">List</span>&lt;<span class="pl-smi">URL</span>&gt; <span class="pl-s1">toUrlsWithoutEmpty</span>(<span class="pl-smi">URL</span> <span class="pl-s1">consumer</span>, <span class="pl-smi">List</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">providers</span>) {
        <span class="pl-smi">List</span>&lt;<span class="pl-smi">URL</span>&gt; <span class="pl-s1">urls</span> = <span class="pl-k">new</span> <span class="pl-smi">ArrayList</span>&lt;&gt;();
        <span class="pl-k">if</span> (<span class="pl-smi">CollectionUtils</span>.<span class="pl-en">isNotEmpty</span>(<span class="pl-s1">providers</span>)) {
            <span class="pl-k">for</span> (<span class="pl-smi">String</span> <span class="pl-s1">provider</span> : <span class="pl-s1">providers</span>) {
                <span class="pl-k">if</span> (<span class="pl-s1">provider</span>.<span class="pl-en">contains</span>(<span class="pl-c1">PROTOCOL_SEPARATOR_ENCODED</span>)) {
                    <span class="pl-c">//  parseEncodedStr() method can't  parse paramter wieh "default." prefix</span>
                    <span class="pl-smi">URL</span> <span class="pl-s1">url</span> = <span class="pl-smi">URLStrParser</span>.<span class="pl-en">parseEncodedStr</span>(<span class="pl-s1">provider</span>);
                    <span class="pl-k">if</span> (<span class="pl-smi">UrlUtils</span>.<span class="pl-en">isMatch</span>(<span class="pl-s1">consumer</span>, <span class="pl-s1">url</span>)) {
                        <span class="pl-s1">urls</span>.<span class="pl-en">add</span>(<span class="pl-s1">url</span>);
                    }
                }
            }
        }
        <span class="pl-k">return</span> <span class="pl-s1">urls</span>;
    }</pre></div>
<p dir="auto"><code class="notranslate">URLStrParser.parseEncodedStr</code> method is not compatible with "default." prefix</p>
<p dir="auto">ps: I found <code class="notranslate">URL.valueOf</code> method has fixed the similar <a href="https://github.com/apache/dubbo/blob/2.7.8-release/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java#L263">problem</a></p>