<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.6</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>import spring-cloud-starter-dubb</li>
<li>config consumer:</li>
</ol>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" dubbo:
  consumer:
    check: false
  #    timeout: 5000
  protocol:
    name: dubbo
    port: -1
  cloud:
    subscribed-services: 'spring-cloud-alibaba-dubbo-provider'"><pre class="notranslate"> <span class="pl-ent">dubbo</span>:
  <span class="pl-ent">consumer</span>:
    <span class="pl-ent">check</span>: <span class="pl-c1">false</span>
  <span class="pl-c"><span class="pl-c">#</span>    timeout: 5000</span>
  <span class="pl-ent">protocol</span>:
    <span class="pl-ent">name</span>: <span class="pl-s">dubbo</span>
    <span class="pl-ent">port</span>: <span class="pl-c1">-1</span>
  <span class="pl-ent">cloud</span>:
    <span class="pl-ent">subscribed-services</span>: <span class="pl-s"><span class="pl-pds">'</span>spring-cloud-alibaba-dubbo-provider<span class="pl-pds">'</span></span></pre></div>
<ol start="3" dir="auto">
<li>config provider</li>
</ol>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
dubbo:
  scan:
    base-packages: com.example.test.dubbo.provider.service
  protocol:
    name: dubbo
    port: -1
  registry:
    address: spring-cloud://localhost
  cloud:
    subscribed-services: ''"><pre class="notranslate"><span class="pl-ent">dubbo</span>:
  <span class="pl-ent">scan</span>:
    <span class="pl-ent">base-packages</span>: <span class="pl-s">com.example.test.dubbo.provider.service</span>
  <span class="pl-ent">protocol</span>:
    <span class="pl-ent">name</span>: <span class="pl-s">dubbo</span>
    <span class="pl-ent">port</span>: <span class="pl-c1">-1</span>
  <span class="pl-ent">registry</span>:
    <span class="pl-ent">address</span>: <span class="pl-s">spring-cloud://localhost</span>
  <span class="pl-ent">cloud</span>:
    <span class="pl-ent">subscribed-services</span>: <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span></pre></div>
<ol start="4" dir="auto">
<li>run provider and consumer</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>
no error log</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">Console print an error log:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="2020-05-28 18:41:20.682 [spring-cloud-alibaba-dubbo-consumer,,,,] 22320 --- [           main] .a.d.m.s.InMemoryWritableMetadataService :  [DUBBO] publishProvider interfaceName is empty . providerUrl: consumer://10.176.128.248/com.alibaba.cloud.dubbo.service.DubboMetadataService?application=spring-cloud-alibaba-dubbo-consumer&amp;check=false&amp;dubbo=2.0.2&amp;generic=true&amp;group=spring-cloud-alibaba-dubbo-provider&amp;interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&amp;pid=22320&amp;qos.enable=false&amp;release=2.7"><pre class="notranslate">2020-05-28 18:41:20.682 [spring-cloud-alibaba-dubbo-consumer,,,,] 22320 --- [           main] .a.d.m.s.InMemoryWritableMetadataService <span class="pl-c1">:</span>  [DUBBO] publishProvider interfaceName is empty <span class="pl-c1">.</span> providerUrl: consumer://10.176.128.248/com.alibaba.cloud.dubbo.service.DubboMetadataService<span class="pl-k">?</span>application=spring-cloud-alibaba-dubbo-consumer<span class="pl-k">&amp;</span>check=false<span class="pl-k">&amp;</span>dubbo=2.0.2<span class="pl-k">&amp;</span>generic=true<span class="pl-k">&amp;</span>group=spring-cloud-alibaba-dubbo-provider<span class="pl-k">&amp;</span>interface=com.alibaba.cloud.dubbo.service.DubboMetadataService<span class="pl-k">&amp;</span>pid=22320<span class="pl-k">&amp;</span>qos.enable=false<span class="pl-k">&amp;</span>release=2.7</pre></div>
<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>
<p dir="auto">Reference code:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" public void publishServiceDefinition(URL providerUrl) {
        try {
            String interfaceName = providerUrl.getParameter(INTERFACE_KEY);
            if (StringUtils.isNotEmpty(interfaceName)
                    &amp;&amp; !ProtocolUtils.isGeneric(providerUrl.getParameter(GENERIC_KEY))) {
                Class interfaceClass = Class.forName(interfaceName);
                ServiceDefinition serviceDefinition = ServiceDefinitionBuilder.build(interfaceClass);
                Gson gson = new Gson();
                String data = gson.toJson(serviceDefinition);
                serviceDefinitions.put(providerUrl.getServiceKey(), data);
                return;
            }
            logger.error(&quot;publishProvider interfaceName is empty . providerUrl: &quot; + providerUrl.toFullString());
        } catch (ClassNotFoundException e) {
            //ignore error
            logger.error(&quot;publishProvider getServiceDescriptor error. providerUrl: &quot; + providerUrl.toFullString(), e);
        }
    }"><pre class="notranslate"> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-s1">publishServiceDefinition</span>(<span class="pl-smi">URL</span> <span class="pl-s1">providerUrl</span>) {
        <span class="pl-k">try</span> {
            <span class="pl-smi">String</span> <span class="pl-s1">interfaceName</span> = <span class="pl-s1">providerUrl</span>.<span class="pl-en">getParameter</span>(<span class="pl-c1">INTERFACE_KEY</span>);
            <span class="pl-k">if</span> (<span class="pl-smi">StringUtils</span>.<span class="pl-en">isNotEmpty</span>(<span class="pl-s1">interfaceName</span>)
                    &amp;&amp; !<span class="pl-smi">ProtocolUtils</span>.<span class="pl-en">isGeneric</span>(<span class="pl-s1">providerUrl</span>.<span class="pl-en">getParameter</span>(<span class="pl-c1">GENERIC_KEY</span>))) {
                <span class="pl-smi">Class</span> <span class="pl-s1">interfaceClass</span> = <span class="pl-smi">Class</span>.<span class="pl-en">forName</span>(<span class="pl-s1">interfaceName</span>);
                <span class="pl-smi">ServiceDefinition</span> <span class="pl-s1">serviceDefinition</span> = <span class="pl-smi">ServiceDefinitionBuilder</span>.<span class="pl-en">build</span>(<span class="pl-s1">interfaceClass</span>);
                <span class="pl-smi">Gson</span> <span class="pl-s1">gson</span> = <span class="pl-k">new</span> <span class="pl-smi">Gson</span>();
                <span class="pl-smi">String</span> <span class="pl-s1">data</span> = <span class="pl-s1">gson</span>.<span class="pl-en">toJson</span>(<span class="pl-s1">serviceDefinition</span>);
                <span class="pl-s1">serviceDefinitions</span>.<span class="pl-en">put</span>(<span class="pl-s1">providerUrl</span>.<span class="pl-en">getServiceKey</span>(), <span class="pl-s1">data</span>);
                <span class="pl-k">return</span>;
            }
            <span class="pl-s1">logger</span>.<span class="pl-en">error</span>(<span class="pl-s">"publishProvider interfaceName is empty . providerUrl: "</span> + <span class="pl-s1">providerUrl</span>.<span class="pl-en">toFullString</span>());
        } <span class="pl-k">catch</span> (<span class="pl-smi">ClassNotFoundException</span> <span class="pl-s1">e</span>) {
            <span class="pl-c">//ignore error</span>
            <span class="pl-s1">logger</span>.<span class="pl-en">error</span>(<span class="pl-s">"publishProvider getServiceDescriptor error. providerUrl: "</span> + <span class="pl-s1">providerUrl</span>.<span class="pl-en">toFullString</span>(), <span class="pl-s1">e</span>);
        }
    }</pre></div>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public static boolean isGeneric(String generic) {
        return StringUtils.isNotEmpty(generic)
                &amp;&amp; (GENERIC_SERIALIZATION_DEFAULT.equalsIgnoreCase(generic)  /* Normal generalization cal */
                || GENERIC_SERIALIZATION_NATIVE_JAVA.equalsIgnoreCase(generic) /* Streaming generalization call supporting jdk serialization */
                || GENERIC_SERIALIZATION_BEAN.equalsIgnoreCase(generic)
                || GENERIC_SERIALIZATION_PROTOBUF.equalsIgnoreCase(generic)
                || GENERIC_RAW_RETURN.equalsIgnoreCase(generic));

    }"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-smi">boolean</span> <span class="pl-s1">isGeneric</span>(<span class="pl-smi">String</span> <span class="pl-s1">generic</span>) {
        <span class="pl-k">return</span> <span class="pl-smi">StringUtils</span>.<span class="pl-en">isNotEmpty</span>(<span class="pl-s1">generic</span>)
                &amp;&amp; (<span class="pl-smi">GENERIC_SERIALIZATION_DEFAULT</span>.<span class="pl-en">equalsIgnoreCase</span>(<span class="pl-s1">generic</span>)  <span class="pl-c">/* Normal generalization cal */</span>
                || <span class="pl-smi">GENERIC_SERIALIZATION_NATIVE_JAVA</span>.<span class="pl-en">equalsIgnoreCase</span>(<span class="pl-s1">generic</span>) <span class="pl-c">/* Streaming generalization call supporting jdk serialization */</span>
                || <span class="pl-smi">GENERIC_SERIALIZATION_BEAN</span>.<span class="pl-en">equalsIgnoreCase</span>(<span class="pl-s1">generic</span>)
                || <span class="pl-smi">GENERIC_SERIALIZATION_PROTOBUF</span>.<span class="pl-en">equalsIgnoreCase</span>(<span class="pl-s1">generic</span>)
                || <span class="pl-smi">GENERIC_RAW_RETURN</span>.<span class="pl-en">equalsIgnoreCase</span>(<span class="pl-s1">generic</span>));

    }</pre></div>
<p dir="auto">How to eliminate this error?</p>
<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/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">Environment</h3>
<ul dir="auto">
<li>Dubbo version: xxx</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>xxx</li>
<li>xxx</li>
<li>xxx</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>