<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.7</li>
<li>Operating System version: xxx</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>@DubboReference(check = false, protocol = "hessian")<br>
private HkService hkService;</li>
<li>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" EchoService echoService = (EchoService) hkService;
 Object oj = echoService.$echo(&quot;成立&quot;);"><pre class="notranslate"><code class="notranslate"> EchoService echoService = (EchoService) hkService;
 Object oj = echoService.$echo("成立");
</code></pre></div>
</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">ok</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">org.apache.dubbo.common.bytecode.NoSuchMethodException: Not found method "$echo" in class com.example.service.HkService.<br>
at org.apache.dubbo.common.bytecode.Wrapper2.invokeMethod(Wrapper2.java)<br>
at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)<br>
at org.apache.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:84)<br>
at org.apache.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:113)<br>
at org.apache.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:163)<br>
at org.apache.dubbo.rpc.protocol.AsyncToSyncInvoker.invoke(AsyncToSyncInvoker.java:52)<br>
at org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:78)<br>
at com.alibaba.dubbo.rpc.Invoker$CompatibleInvoker.invoke(Invoker.java:55)<br>
at io.seata.integration.dubbo.alibaba.AlibabaDubboTransactionPropagationFilter.invoke(AlibabaDubboTransactionPropagationFilter.java:43)<br>
at com.alibaba.dubbo.rpc.Filter.invoke(Filter.java:29)<br>
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81)<br>
at io.seata.integration.dubbo.ApacheDubboTransactionPropagationFilter.invoke(ApacheDubboTransactionPropagationFilter.java:65)<br>
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81)<br>
at co.faao.plugin.filter.ConsumerExceptionFilter.invoke(ConsumerExceptionFilter.java:28)</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>
<p dir="auto"><a href="url">https://github.com/apache/dubbo/issues/5479</a></p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.7</li>
<li>Operating System version: CentOS Linux release 7.6.1810 (Core)</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>org.apache.dubbo.rpc.proxy.AbstractProxyFactory</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="      if (generic) {
            if (!GenericService.class.isAssignableFrom(invoker.getInterface())) {
                interfaces.add(com.alibaba.dubbo.rpc.service.GenericService.class);
            }

            try {
                // find the real interface from url
                String realInterface = invoker.getUrl().getParameter(Constants.INTERFACE);
                interfaces.add(ReflectUtils.forName(realInterface));
            } catch (Throwable e) {
                // ignore
            }
        } "><pre class="notranslate"><code class="notranslate">      if (generic) {
            if (!GenericService.class.isAssignableFrom(invoker.getInterface())) {
                interfaces.add(com.alibaba.dubbo.rpc.service.GenericService.class);
            }

            try {
                // find the real interface from url
                String realInterface = invoker.getUrl().getParameter(Constants.INTERFACE);
                interfaces.add(ReflectUtils.forName(realInterface));
            } catch (Throwable e) {
                // ignore
            }
        } 
</code></pre></div>
<ol start="2" dir="auto">
<li>当设置泛化调用时，在客户端创建代理AbstractProxyFactory这一步添加realInterface之后，如果在realInterface这个接口类里有包含当前创建代理类的系统没有依赖的包时(堆栈里的common.result.PagingQueryResult未被consumer依赖)，会在接下来创建代理的是时候报错NoClassDefFoundError</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    //create consumer
    ReferenceConfig&lt;GenericService&gt; reference = new ReferenceConfig&lt;&gt;();
    reference.setInterface(ifaceName);
    reference.setConsumer(consumerConfig);
    reference.setGeneric(&quot;true&quot;);
    reference.setAsync(true);
    reference.setCheck(false);
    ReferenceConfigCache cache = ReferenceConfigCache.getCache();
    GenericService genericService = cache.get(reference);"><pre class="notranslate"><code class="notranslate">    //create consumer
    ReferenceConfig&lt;GenericService&gt; reference = new ReferenceConfig&lt;&gt;();
    reference.setInterface(ifaceName);
    reference.setConsumer(consumerConfig);
    reference.setGeneric("true");
    reference.setAsync(true);
    reference.setCheck(false);
    ReferenceConfigCache cache = ReferenceConfigCache.getCache();
    GenericService genericService = cache.get(reference);
</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="java.lang.ClassNotFoundException: common.result.PagingQueryResult
0 = {StackTraceElement@13179} &quot;java.lang.Class.getDeclaredMethods0(Native Method)&quot;
1 = {StackTraceElement@13180} &quot;java.lang.Class.privateGetDeclaredMethods(Class.java:2701)&quot;
2 = {StackTraceElement@13181} &quot;java.lang.Class.privateGetPublicMethods(Class.java:2902)&quot;
3 = {StackTraceElement@13182} &quot;java.lang.Class.getMethods(Class.java:1615)&quot;
4 = {StackTraceElement@13183} &quot;org.apache.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:156)&quot;
5 = {StackTraceElement@13184} &quot;org.apache.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:66)&quot;
6 = {StackTraceElement@13185} &quot;org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:35)&quot;
7 = {StackTraceElement@13186} &quot;org.apache.dubbo.rpc.proxy.AbstractProxyFactory.getProxy(AbstractProxyFactory.java:79)&quot;
8 = {StackTraceElement@13187} &quot;org.apache.dubbo.rpc.proxy.wrapper.StubProxyFactoryWrapper.getProxy(StubProxyFactoryWrapper.java:66)&quot;
9 = {StackTraceElement@13188} &quot;org.apache.dubbo.rpc.ProxyFactory$Adaptive.getProxy(ProxyFactory$Adaptive.java)&quot;
10 = {StackTraceElement@13189} &quot;org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:366)&quot;
11 = {StackTraceElement@13190} &quot;org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:258)&quot;
12 = {StackTraceElement@13191} &quot;org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:158)&quot;
13 = {StackTraceElement@13192} &quot;org.apache.dubbo.config.utils.ReferenceConfigCache.lambda$get$3(ReferenceConfigCache.java:114)&quot;
14 = {StackTraceElement@13193} &quot;java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)&quot;
15 = {StackTraceElement@13194} &quot;org.apache.dubbo.config.utils.ReferenceConfigCache.get(ReferenceConfigCache.java:113)&quot;"><pre class="notranslate"><code class="notranslate">java.lang.ClassNotFoundException: common.result.PagingQueryResult
0 = {StackTraceElement@13179} "java.lang.Class.getDeclaredMethods0(Native Method)"
1 = {StackTraceElement@13180} "java.lang.Class.privateGetDeclaredMethods(Class.java:2701)"
2 = {StackTraceElement@13181} "java.lang.Class.privateGetPublicMethods(Class.java:2902)"
3 = {StackTraceElement@13182} "java.lang.Class.getMethods(Class.java:1615)"
4 = {StackTraceElement@13183} "org.apache.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:156)"
5 = {StackTraceElement@13184} "org.apache.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:66)"
6 = {StackTraceElement@13185} "org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:35)"
7 = {StackTraceElement@13186} "org.apache.dubbo.rpc.proxy.AbstractProxyFactory.getProxy(AbstractProxyFactory.java:79)"
8 = {StackTraceElement@13187} "org.apache.dubbo.rpc.proxy.wrapper.StubProxyFactoryWrapper.getProxy(StubProxyFactoryWrapper.java:66)"
9 = {StackTraceElement@13188} "org.apache.dubbo.rpc.ProxyFactory$Adaptive.getProxy(ProxyFactory$Adaptive.java)"
10 = {StackTraceElement@13189} "org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:366)"
11 = {StackTraceElement@13190} "org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:258)"
12 = {StackTraceElement@13191} "org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:158)"
13 = {StackTraceElement@13192} "org.apache.dubbo.config.utils.ReferenceConfigCache.lambda$get$3(ReferenceConfigCache.java:114)"
14 = {StackTraceElement@13193} "java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)"
15 = {StackTraceElement@13194} "org.apache.dubbo.config.utils.ReferenceConfigCache.get(ReferenceConfigCache.java:113)"
</code></pre></div>