<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: xxx</li>
<li>Operating System version: centos 7</li>
<li>Java version: 1.8.0</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">Class.forName 使用的MetadataReportService 的classloader 来加载interface,<br>
但是这个interface 可能是另外的class loader 加载的，会报找不到class.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2019-08-01 12:15:26,110 ERROR org.apache.dubbo.metadata.integration.MetadataReportService[106] -  [DUBBO] publishProvider getServiceDescriptor error. providerUrl: dubbo://192.168.0.9:20880/com.wdk.SpiTes?anyhost=true&amp;application=wdk-plugin-engine&amp;dubbo=2.0.2&amp;generic=false&amp;group=dubbo&amp;interface=com.wdk.SpiTes&amp;methods=speak&amp;proxy=jdk&amp;release=2.7.1-SNAPSHOT&amp;revision=1.0.0-SNAPSHOT&amp;side=provider&amp;version=1.0.0.wdk-serverless-bundle.1.0.0, dubbo version: 2.7.1-SNAPSHOT, current host: 192.168.0.9
java.lang.ClassNotFoundException: com.wdk.SpiTes"><pre lang="log" class="notranslate"><code class="notranslate">2019-08-01 12:15:26,110 ERROR org.apache.dubbo.metadata.integration.MetadataReportService[106] -  [DUBBO] publishProvider getServiceDescriptor error. providerUrl: dubbo://192.168.0.9:20880/com.wdk.SpiTes?anyhost=true&amp;application=wdk-plugin-engine&amp;dubbo=2.0.2&amp;generic=false&amp;group=dubbo&amp;interface=com.wdk.SpiTes&amp;methods=speak&amp;proxy=jdk&amp;release=2.7.1-SNAPSHOT&amp;revision=1.0.0-SNAPSHOT&amp;side=provider&amp;version=1.0.0.wdk-serverless-bundle.1.0.0, dubbo version: 2.7.1-SNAPSHOT, current host: 192.168.0.9
java.lang.ClassNotFoundException: com.wdk.SpiTes
</code></pre></div>
<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>
<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>
<p dir="auto">At the moment we create the adaptive extension class by <code class="notranslate">org.apache.dubbo.common.extension.ExtensionLoader#createAdaptiveExtensionClass</code>, which generates a Java class source <code class="notranslate">String</code> and compiles it.</p>
<p dir="auto">So I'm wondering why is this strategy chosen and can we generate a proxy class directly (for example using cglib) of the adaptive extension class, it would save the time to compile and reduce the complexity when manipulating <code class="notranslate">String</code> to generate the source code, thus less errors may occur and more performant(I think).</p>
<p dir="auto">Thanks</p>