<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.5</li>
<li>Operating System version: macOs Mojave 10.14.6</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>正常启动项目后无法使用telnet的<code class="notranslate">ls</code>,<code class="notranslate">cd</code>,<code class="notranslate">invoke</code>等命令；</li>
<li>自己通过debug发现，在读取<code class="notranslate">/META-INF/dubbo/internal/org.apache.dubbo.remoting.telnet.TelnetHandler</code>这个配置文件的时候，在解析第6到14这几行的时候，出现了类加载失败的情况。</li>
<li>于是我便去源码中找了这几个类，发现它们的包结构和之前的版本<code class="notranslate">2.7.4.1</code>有所不同。</li>
<li>这几个类由<code class="notranslate">org.apache.dubbo.rpc.protocol.dubbo.telnet</code>包移动到了<code class="notranslate">org.apache.dubbo.qos.legacy</code>这个包下面。</li>
<li>我不知道我有没有找到根本原因，但这一定是其中之一，目前也有一个解决办法，并且我已经使用这个方法解决了这个问题。我把这些加载失败的Telnet类，放到了Telnet扩展中。</li>
</ol>
<h3 dir="auto">解决方案</h3>
<p dir="auto">把临时解决方案贴上来，希望能帮助遇到同样问题的小伙伴。<br>
在项目<code class="notranslate">resources</code>目录中添加<code class="notranslate">META-INF/dubbo/org.apache.dubbo.remoting.telnet.TelnetHandler</code>文本文件，然后将加载失败的类包名修改后，配置到文件中。</p>
<p dir="auto">文件内容如下：</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ls=org.apache.dubbo.qos.legacy.ListTelnetHandler
ps=org.apache.dubbo.qos.legacy.PortTelnetHandler
cd=org.apache.dubbo.qos.legacy.ChangeTelnetHandler
pwd=org.apache.dubbo.qos.legacy.CurrentTelnetHandler
invoke=org.apache.dubbo.qos.legacy.InvokeTelnetHandler
trace=org.apache.dubbo.qos.legacy.TraceTelnetHandler
count=org.apache.dubbo.qos.legacy.CountTelnetHandler
select=org.apache.dubbo.qos.legacy.SelectTelnetHandler
shutdown=org.apache.dubbo.qos.legacy.ShutdownTelnetHandler
clear=org.apache.dubbo.remoting.telnet.support.command.ClearTelnetHandler
exit=org.apache.dubbo.remoting.telnet.support.command.ExitTelnetHandler
help=org.apache.dubbo.remoting.telnet.support.command.HelpTelnetHandler
status=org.apache.dubbo.remoting.telnet.support.command.StatusTelnetHandler
log=org.apache.dubbo.remoting.telnet.support.command.LogTelnetHandler"><pre class="notranslate"><code class="notranslate">ls=org.apache.dubbo.qos.legacy.ListTelnetHandler
ps=org.apache.dubbo.qos.legacy.PortTelnetHandler
cd=org.apache.dubbo.qos.legacy.ChangeTelnetHandler
pwd=org.apache.dubbo.qos.legacy.CurrentTelnetHandler
invoke=org.apache.dubbo.qos.legacy.InvokeTelnetHandler
trace=org.apache.dubbo.qos.legacy.TraceTelnetHandler
count=org.apache.dubbo.qos.legacy.CountTelnetHandler
select=org.apache.dubbo.qos.legacy.SelectTelnetHandler
shutdown=org.apache.dubbo.qos.legacy.ShutdownTelnetHandler
clear=org.apache.dubbo.remoting.telnet.support.command.ClearTelnetHandler
exit=org.apache.dubbo.remoting.telnet.support.command.ExitTelnetHandler
help=org.apache.dubbo.remoting.telnet.support.command.HelpTelnetHandler
status=org.apache.dubbo.remoting.telnet.support.command.StatusTelnetHandler
log=org.apache.dubbo.remoting.telnet.support.command.LogTelnetHandler
</code></pre></div>
<p dir="auto">在项目中添加配置项：</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dubbo.protocol.telnet=clear,exit,help,status,log,ls,ps,cd,pwd,invoke,trace,count,select,shutdown"><pre class="notranslate"><code class="notranslate">dubbo.protocol.telnet=clear,exit,help,status,log,ls,ps,cd,pwd,invoke,trace,count,select,shutdown
</code></pre></div>
<p dir="auto">使用方法在官方文档中有说明：<a href="http://dubbo.apache.org/zh-cn/docs/dev/impls/telnet-handler.html" rel="nofollow">扩展telnet</a><br>
这个问题修改<code class="notranslate">/META-INF/dubbo/internal/org.apache.dubbo.remoting.telnet.TelnetHandler</code>的文件内容后就会解决，如有使用不当之处，还望开发者回复。</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="Unsupported command: ls"><pre class="notranslate"><code class="notranslate">Unsupported command: ls
</code></pre></div>
<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: linux centos 7</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">[INFO] --------------------------------[ jar ]---------------------------------<br>
Downloading from alibaba-opensource-releases: <a href="http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo.rpc/maven-metadata.xml" rel="nofollow">http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo.rpc/maven-metadata.xml</a><br>
^@[WARNING] Could not transfer metadata com.alibaba.platform.shared:dubbo.rpc/maven-metadata.xml from/to alibaba-opensource-releases (<a href="http://code.alibabatech.com/mvn/releases" rel="nofollow">http://code.alibabatech.com/mvn/releases</a>): Transfer failed for <a href="http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo.rpc/maven-metadata.xml" rel="nofollow">http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo.rpc/maven-metadata.xml</a><br>
Downloading from alibaba-opensource-releases: <a href="http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo.remoting/maven-metadata.xml" rel="nofollow">http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo.remoting/maven-metadata.xml</a><br>
^@^@[WARNING] Could not transfer metadata com.alibaba.platform.shared:dubbo.remoting/maven-metadata.xml from/to alibaba-opensource-releases (<a href="http://code.alibabatech.com/mvn/releases" rel="nofollow">http://code.alibabatech.com/mvn/releases</a>): Transfer failed for <a href="http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo.remoting/maven-metadata.xml" rel="nofollow">http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo.remoting/maven-metadata.xml</a><br>
Downloading from alibaba-opensource-releases: <a href="http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo/maven-metadata.xml" rel="nofollow">http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo/maven-metadata.xml</a><br>
^@^@[WARNING] Could not transfer metadata com.alibaba.platform.shared:dubbo/maven-metadata.xml from/to alibaba-opensource-releases (<a href="http://code.alibabatech.com/mvn/releases" rel="nofollow">http://code.alibabatech.com/mvn/releases</a>): Transfer failed for <a href="http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo/maven-metadata.xml" rel="nofollow">http://code.alibabatech.com/mvn/releases/com/alibaba/platform/shared/dubbo/maven-metadata.xml</a></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>