<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.7</li>
<li>Operating System version: macOS 10.15.3</li>
<li>Java version: 1.8.0_11</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15379292/92544700-1d082f00-f281-11ea-8cc0-f45862fafbfe.png"><img src="https://user-images.githubusercontent.com/15379292/92544700-1d082f00-f281-11ea-8cc0-f45862fafbfe.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">It is recommended to add a default constructor, otherwise some serialization tools like <code class="notranslate">kryo</code> cannot work well</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>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.2</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="           //泛化调用，异步
            ref.$invoke(callMethod, typeArrays, objectArrays);

            //2.7.1正常，2.7.2出现npe
            String uri = RpcContext.getContext().getUrl().toFullString();
            event.setTotalUri(uri);

            Future&lt;Object&gt; result = RpcContext.getContext().getFuture();
"><pre class="notranslate">           <span class="pl-c">//泛化调用，异步</span>
            <span class="pl-s1">ref</span>.<span class="pl-en">$invoke</span>(<span class="pl-s1">callMethod</span>, <span class="pl-s1">typeArrays</span>, <span class="pl-s1">objectArrays</span>);

            <span class="pl-c">//2.7.1正常，2.7.2出现npe</span>
            <span class="pl-smi">String</span> <span class="pl-s1">uri</span> = <span class="pl-smi">RpcContext</span>.<span class="pl-en">getContext</span>().<span class="pl-en">getUrl</span>().<span class="pl-en">toFullString</span>();
            <span class="pl-s1">event</span>.<span class="pl-en">setTotalUri</span>(<span class="pl-s1">uri</span>);

            <span class="pl-smi">Future</span>&lt;<span class="pl-smi">Object</span>&gt; <span class="pl-s1">result</span> = <span class="pl-smi">RpcContext</span>.<span class="pl-en">getContext</span>().<span class="pl-en">getFuture</span>();</pre></div>
<p dir="auto">上面同一段代码，2.7.1的时候没有问题， 2.7.2 RpcContext.getContext().getUrl().toFullString();会出现npe</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2860398/60083357-2a162c80-9768-11e9-8c70-3f2c00560598.png"><img src="https://user-images.githubusercontent.com/2860398/60083357-2a162c80-9768-11e9-8c70-3f2c00560598.png" alt="image" style="max-width: 100%;"></a></p>