dubbo
dubbo copied to clipboard
Telnet does not support invoke a method of set parameter
- [ x ] I have searched the issues of this repository and believe that this is not a duplicate.
- [ x ] I have checked the FAQ of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: latest
- Operating System version: mac
- Java version: 1.8
Steps to reproduce this issue
public interface DemoService {
int getListSize(List list);
int getSetSize(Set set);
}
- telnet localhost 20881
- invoke xxx.getListSize([1,2,3])
- invoke xxx.getSetSize([1,2,3])
Expected Result
- ok
- ok
Actual Result
- ok
- No such method
may this pr #2801 can solve you problem.
no, did not resolve this problem
the cause of the problem: org.apache.dubbo.rpc.protocol.dubbo.telnet.InvokeTelnetHandler#isMatch
// arg(JSONArray instance) is Assignable From List
// Set not match
else if (arg instanceof Collection) {
if (!type.isArray() && !type.isAssignableFrom(arg.getClass())) {
return false;
}
}
actually, PojoUtils#realize can convert JSONArray to Set
invoke DemoService.getSetSize(Set[1,2,3])