<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: mac</li>
<li>Java version: 8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto"><strong>问题</strong></p>
<blockquote>
<p dir="auto">ReferenceConfig.checkRegistry()时获取不到注册地址信息。</p>
</blockquote>
<p dir="auto"><strong>分析</strong><br>
2.7.7获取组册中心貌似都是通过<code class="notranslate">ApplicationModel.getConfigManager().getDefaultRegistries()</code>或者是<code class="notranslate"> ApplicationModel.getConfigManager().getRegistry(id)</code>，但是这两个目前都获取出来得是null。<br>
这些数据是在AbstractConfig里面存放的，具体代码如下：</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    @PostConstruct
    public void addIntoConfigManager() {
        ApplicationModel.getConfigManager().addConfig(this);
    }"><pre class="notranslate">    <span class="pl-c1">@</span><span class="pl-c1">PostConstruct</span>
    <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-s1">addIntoConfigManager</span>() {
        <span class="pl-smi">ApplicationModel</span>.<span class="pl-en">getConfigManager</span>().<span class="pl-en">addConfig</span>(<span class="pl-smi">this</span>);
    }</pre></div>
<p dir="auto"><strong>原因</strong><br>
在<code class="notranslate">AbstraceApplicationContext.invokeBeanFactoryPostProcessors</code>时，会提前触发ReferenceConfig提前被加载，我这里是因为加载<code class="notranslate">serviceAnnotationBeanPostProcessor</code>触发的。<br>
导致PostConstuct没加载。所以注册中心数据没进去。</p>
<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 dir="auto">
<li>[*] 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>[*] 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: 2.6.3</li>
<li>Operating System version: macos</li>
<li>Java version: 1.8.0</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">dubbo2.6.3 服务提供者中使用泛化调用时，绑定attachments时interface错误</p>
<p dir="auto">dubbo服务提供者中使用泛化调用时，绑定attachments时interface错误，导致thrift encode失败：Could not encode request, the specified interface may be incorrect.</p>
<ol dir="auto">
<li>调用方调用 interfaceA.methodA方法</li>
<li>methodA中通过泛化调用interfaceB.methodB方法</li>
<li>attachements中的interface参数为interfaceA，而不是interfaceB</li>
</ol>
<p dir="auto">问题出现在AbstractClusterInvoker中的233行：<br>
`<br>
// binding attachments into invocation.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    Map&lt;String, String&gt; contextAttachments = RpcContext.getContext().getAttachments();

    if (contextAttachments != null &amp;&amp; contextAttachments.size() != 0) {

        ((RpcInvocation) invocation).addAttachments(contextAttachments);

    }"><pre class="notranslate"><code class="notranslate">    Map&lt;String, String&gt; contextAttachments = RpcContext.getContext().getAttachments();

    if (contextAttachments != null &amp;&amp; contextAttachments.size() != 0) {

        ((RpcInvocation) invocation).addAttachments(contextAttachments);

    }
</code></pre></div>
<p dir="auto">`</p>