<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: linux,macos</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>使用2.5.6版本发布dubbo服务</li>
<li>依照<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="396414329" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/3163" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/3163/hovercard" href="https://github.com/apache/dubbo/issues/3163">#3163</a> 功能进行泛化调用，声明客户端异步化调用</li>
<li>Future 返回值中报错如下(method '$invokeAsync' not found)，错误来源于服务端；</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Failed to invoke remote proxy method $invokeAsync to registry://10.179.84.162:2181/com.alibaba.dubbo.registry.RegistryService?application=htw-facade&amp;application.name=htw-facade&amp;dubbo=2.5.3-didi-24&amp;export=dubbo%3A%2F%2F10.179.25.19%3A7778%2Fcom.d.h.f.a.s.F*Service%3Fanyhost%3Dtrue%26application%3Dh-f%26application.name%3Dh-f%26default.service.filter%3DBhBizProviderFilter%2CBhDLProviderFilter%2CBhMetricsProviderFilter%2CDubboProviderContextSwitchFilter%26default.threads%3D500%26default.token%3Dtrue%26dispatcher%3Dmessage%26dubbo%3D2.5.3-didi-24%26interface%3Dcom.d.h.f.a.s.F*Service%26methods%3DoutAuthAndSendVoucher%2CqueryCardRemainInfo%2ChealthData%2CgetCityConfigControlResult%2CgetTripEndPopResult%2CactivityConfig%2CqrCodeUrlAnalyze%2CoutAuthCheck%2CfindTripEndPopResult%26owner%3D*%26pid%3D34411%26revision%3D1.0.2%26side%3Dprovider%26threadname%3DnonCoreFacadeProvider%26threads%3D100%26timestamp%3D1597290687001%26version%3D1.0.0_stable&amp;file=/h/x/h/dubboLocal.cache&amp;owner=*&amp;pid=34411&amp;registry=zookeeper&amp;timestamp=1597290687000, cause: Not found method \&quot;$invokeAsync\&quot; in class com.d.h.f.a.s.F*Service."><pre class="notranslate"><code class="notranslate">Failed to invoke remote proxy method $invokeAsync to registry://10.179.84.162:2181/com.alibaba.dubbo.registry.RegistryService?application=htw-facade&amp;application.name=htw-facade&amp;dubbo=2.5.3-didi-24&amp;export=dubbo%3A%2F%2F10.179.25.19%3A7778%2Fcom.d.h.f.a.s.F*Service%3Fanyhost%3Dtrue%26application%3Dh-f%26application.name%3Dh-f%26default.service.filter%3DBhBizProviderFilter%2CBhDLProviderFilter%2CBhMetricsProviderFilter%2CDubboProviderContextSwitchFilter%26default.threads%3D500%26default.token%3Dtrue%26dispatcher%3Dmessage%26dubbo%3D2.5.3-didi-24%26interface%3Dcom.d.h.f.a.s.F*Service%26methods%3DoutAuthAndSendVoucher%2CqueryCardRemainInfo%2ChealthData%2CgetCityConfigControlResult%2CgetTripEndPopResult%2CactivityConfig%2CqrCodeUrlAnalyze%2CoutAuthCheck%2CfindTripEndPopResult%26owner%3D*%26pid%3D34411%26revision%3D1.0.2%26side%3Dprovider%26threadname%3DnonCoreFacadeProvider%26threads%3D100%26timestamp%3D1597290687001%26version%3D1.0.0_stable&amp;file=/h/x/h/dubboLocal.cache&amp;owner=*&amp;pid=34411&amp;registry=zookeeper&amp;timestamp=1597290687000, cause: Not found method \"$invokeAsync\" in class com.d.h.f.a.s.F*Service.
</code></pre></div>
<p dir="auto">创建 <code class="notranslate">ReferenceConfig</code> 和调用相关代码</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Service
public class DubboGenericIntegrationServiceImpl implements DubboGenericIntegrationService {

    @Resource
    private ApplicationConfig applicationConfig;

    @Resource
    private List&lt;RegistryConfig&gt; registryConfigs;

    @Resource
    private ConsumerConfig consumerConfig;

    @Nonnull
    @Override
    public ReferenceConfig&lt;GenericService&gt; createReference(
            @Nonnull String serviceName,
            @Nonnull String version,
            boolean async
    ) {
        ReferenceConfig&lt;GenericService&gt; reference = new ReferenceConfig&lt;&gt;();
        reference.setInterface(serviceName);
        reference.setVersion(version);
        reference.setGeneric(Boolean.TRUE.toString());
        reference.setCheck(false);
        reference.setAsync(async);

        reference.setApplication(applicationConfig);
        reference.setRegistries(registryConfigs);
        reference.setConsumer(consumerConfig);
        return reference;
    }

    @Override
    public Object invokeSync(
            @Nonnull GenericService service,
            @Nonnull ProxyInvokeParam param
    ) {
        return service.$invoke(param.getMethod(), param.getParamTypes(), param.getParams());
    }

    @Override
    public CompletableFuture&lt;Object&gt; invokeASync(
            @Nonnull GenericService service,
            @Nonnull ProxyInvokeParam param
    ) {
        return service.$invokeAsync(param.getMethod(), param.getParamTypes(), param.getParams());
    }
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Service</span>
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">DubboGenericIntegrationServiceImpl</span> <span class="pl-k">implements</span> <span class="pl-smi">DubboGenericIntegrationService</span> {

    <span class="pl-c1">@</span><span class="pl-c1">Resource</span>
    <span class="pl-k">private</span> <span class="pl-smi">ApplicationConfig</span> <span class="pl-s1">applicationConfig</span>;

    <span class="pl-c1">@</span><span class="pl-c1">Resource</span>
    <span class="pl-k">private</span> <span class="pl-smi">List</span>&lt;<span class="pl-smi">RegistryConfig</span>&gt; <span class="pl-s1">registryConfigs</span>;

    <span class="pl-c1">@</span><span class="pl-c1">Resource</span>
    <span class="pl-k">private</span> <span class="pl-smi">ConsumerConfig</span> <span class="pl-s1">consumerConfig</span>;

    <span class="pl-c1">@</span><span class="pl-c1">Nonnull</span>
    <span class="pl-c1">@</span><span class="pl-c1">Override</span>
    <span class="pl-k">public</span> <span class="pl-smi">ReferenceConfig</span>&lt;<span class="pl-smi">GenericService</span>&gt; <span class="pl-en">createReference</span>(
            <span class="pl-c1">@</span><span class="pl-c1">Nonnull</span> <span class="pl-smi">String</span> <span class="pl-s1">serviceName</span>,
            <span class="pl-c1">@</span><span class="pl-c1">Nonnull</span> <span class="pl-smi">String</span> <span class="pl-s1">version</span>,
            <span class="pl-smi">boolean</span> <span class="pl-s1">async</span>
    ) {
        <span class="pl-smi">ReferenceConfig</span>&lt;<span class="pl-smi">GenericService</span>&gt; <span class="pl-s1">reference</span> = <span class="pl-k">new</span> <span class="pl-smi">ReferenceConfig</span>&lt;&gt;();
        <span class="pl-s1">reference</span>.<span class="pl-en">setInterface</span>(<span class="pl-s1">serviceName</span>);
        <span class="pl-s1">reference</span>.<span class="pl-en">setVersion</span>(<span class="pl-s1">version</span>);
        <span class="pl-s1">reference</span>.<span class="pl-en">setGeneric</span>(<span class="pl-smi">Boolean</span>.<span class="pl-c1">TRUE</span>.<span class="pl-en">toString</span>());
        <span class="pl-s1">reference</span>.<span class="pl-en">setCheck</span>(<span class="pl-c1">false</span>);
        <span class="pl-s1">reference</span>.<span class="pl-en">setAsync</span>(<span class="pl-s1">async</span>);

        <span class="pl-s1">reference</span>.<span class="pl-en">setApplication</span>(<span class="pl-s1">applicationConfig</span>);
        <span class="pl-s1">reference</span>.<span class="pl-en">setRegistries</span>(<span class="pl-s1">registryConfigs</span>);
        <span class="pl-s1">reference</span>.<span class="pl-en">setConsumer</span>(<span class="pl-s1">consumerConfig</span>);
        <span class="pl-k">return</span> <span class="pl-s1">reference</span>;
    }

    <span class="pl-c1">@</span><span class="pl-c1">Override</span>
    <span class="pl-k">public</span> <span class="pl-smi">Object</span> <span class="pl-en">invokeSync</span>(
            <span class="pl-c1">@</span><span class="pl-c1">Nonnull</span> <span class="pl-smi">GenericService</span> <span class="pl-s1">service</span>,
            <span class="pl-c1">@</span><span class="pl-c1">Nonnull</span> <span class="pl-smi">ProxyInvokeParam</span> <span class="pl-s1">param</span>
    ) {
        <span class="pl-k">return</span> <span class="pl-s1">service</span>.<span class="pl-en">$invoke</span>(<span class="pl-s1">param</span>.<span class="pl-en">getMethod</span>(), <span class="pl-s1">param</span>.<span class="pl-en">getParamTypes</span>(), <span class="pl-s1">param</span>.<span class="pl-en">getParams</span>());
    }

    <span class="pl-c1">@</span><span class="pl-c1">Override</span>
    <span class="pl-k">public</span> <span class="pl-smi">CompletableFuture</span>&lt;<span class="pl-smi">Object</span>&gt; <span class="pl-en">invokeASync</span>(
            <span class="pl-c1">@</span><span class="pl-c1">Nonnull</span> <span class="pl-smi">GenericService</span> <span class="pl-s1">service</span>,
            <span class="pl-c1">@</span><span class="pl-c1">Nonnull</span> <span class="pl-smi">ProxyInvokeParam</span> <span class="pl-s1">param</span>
    ) {
        <span class="pl-k">return</span> <span class="pl-s1">service</span>.<span class="pl-en">$invokeAsync</span>(<span class="pl-s1">param</span>.<span class="pl-en">getMethod</span>(), <span class="pl-s1">param</span>.<span class="pl-en">getParamTypes</span>(), <span class="pl-s1">param</span>.<span class="pl-en">getParams</span>());
    }
}</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/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: &gt;= 2.7.9</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"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15549777/93314519-71407f80-f83c-11ea-816a-b273c56d610d.png"><img src="https://user-images.githubusercontent.com/15549777/93314519-71407f80-f83c-11ea-816a-b273c56d610d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Should you decide that file=N/A means disabled?</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>