You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "sunlongv587 (GitHub)" <gi...@apache.org> on 2020/01/21 11:17:23 UTC
[GitHub] [dubbo] sunlongv587 opened issue #5690: Dubbo Telnet
Unsupported command: ls
- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
### Environment
* Dubbo version: 2.7.5
* Operating System version: macOs Mojave 10.14.6
* Java version: 1.8
### Steps to reproduce this issue
1. 正常启动项目后无法使用telnet的`ls`,`cd`,`invoke`等命令;
2. 自己通过debug发现,在读取`/META-INF/dubbo/internal/org.apache.dubbo.remoting.telnet.TelnetHandler`这个配置文件的时候,在解析第6到14这几行的时候,出现了类加载失败的情况。
3. 于是我便去源码中找了这几个类,发现它们的包结构和之前的版本`2.7.4.1`有所不同。
4. 这几个类由`org.apache.dubbo.rpc.protocol.dubbo.telnet`包移动到了`org.apache.dubbo.qos.legacy`这个包下面。
5. 我不知道我有没有找到根本原因,但这一定是其中之一,目前也有一个解决办法,并且我已经使用这个方法解决了这个问题。我把这些加载失败的Telnet类,放到了Telnet扩展中。
### 解决方案
把临时解决方案贴上来,希望能帮助遇到同样问题的小伙伴。
在项目`resources`目录中添加`META-INF/dubbo/org.apache.dubbo.remoting.telnet.TelnetHandler`文本文件,然后将加载失败的类包名修改后,配置到文件中。
文件内容如下:
```
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
```
在项目中添加配置项:
```
dubbo.protocol.telnet=ls,ps,cd,pwd,invoke,trace,count,select,shutdown
```
使用方法在官方文档中有说明:[扩展telnet](http://dubbo.apache.org/zh-cn/docs/dev/impls/telnet-handler.html)
这个问题修改`/META-INF/dubbo/internal/org.apache.dubbo.remoting.telnet.TelnetHandler`的文件内容后就会解决,如有使用不当之处,还望开发者回复。
Pls. provide [GitHub address] to reproduce this issue.
### Expected Result
What do you expected from the above steps?
### Actual Result
What actually happens?
If there is an exception, please attach the exception trace:
```
Unsupported command: ls
```
[ Full content available at: https://github.com/apache/dubbo/issues/5690 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo] LiosWong commented on issue #5690: Dubbo Telnet
Unsupported command: ls
Posted by "LiosWong (GitHub)" <gi...@apache.org>.
在dubbo-demo中运行provider后,使用telnet也会出现同样的问题
[ Full content available at: https://github.com/apache/dubbo/issues/5690 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo] CrazyHZM closed issue #5690: Dubbo Telnet
Unsupported command: ls
Posted by "CrazyHZM (GitHub)" <gi...@apache.org>.
[ issue closed by CrazyHZM ]
[ Full content available at: https://github.com/apache/dubbo/issues/5690 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo] chenshun00 commented on issue #5690: Dubbo Telnet
Unsupported command: ls
Posted by "chenshun00 (GitHub)" <gi...@apache.org>.
```text
➜ ~ telnet 127.0.0.1 20880
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
ls
Unsupported command: ls
dubbo>ls
Unsupported command: ls
dubbo>status -l
+------------+--------+--------------------------------------------------------+
| resource | status | message |
+------------+--------+--------------------------------------------------------+
| datasource | OK | dataSourcejdbc:mysql://127.0.0.1:3306/cmdb?useUnicode=true&characterEncoding=utf-8&autoReconnect=true(MySQL-5.7.27) |
| load | OK | load:3.7265625,cpu:4 |
| memory | OK | max:1820M,total:251M,used:141M,free:110M |
| registry | OK | 127.0.0.1:2181(connected) |
| server | OK | /192.168.63.127:20880(clients:1) |
| summary | OK | |
+------------+--------+--------------------------------------------------------+
dubbo>quit
Unsupported command: quit
dubbo>exit
Connection closed by foreign host.
```
dubbo 版本 2.7.5
@chickenlj 不知道什么时候修复
[ Full content available at: https://github.com/apache/dubbo/issues/5690 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo] hesherya commented on issue #5690: Dubbo Telnet
Unsupported command: ls
Posted by "hesherya (GitHub)" <gi...@apache.org>.
我去,原来是个坑。
[ Full content available at: https://github.com/apache/dubbo/issues/5690 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org