Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telnet does not support invoke a method of set parameter #2843

Closed
JoneWeng opened this issue Nov 28, 2018 · 4 comments
Closed

Telnet does not support invoke a method of set parameter #2843

JoneWeng opened this issue Nov 28, 2018 · 4 comments

Comments

@JoneWeng
Copy link

JoneWeng commented Nov 28, 2018

  • [ 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);
    
}
  1. telnet localhost 20881
  2. invoke xxx.getListSize([1,2,3])
  3. invoke xxx.getSetSize([1,2,3])

Expected Result

  1. ok
  2. ok

Actual Result

  1. ok
  2. No such method
@kexianjun
Copy link
Member

may this pr #2801 can solve you problem.

@JoneWeng
Copy link
Author

no, did not resolve this problem

@JoneWeng
Copy link
Author

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

@zonghaishang
Copy link
Member

invoke DemoService.getSetSize(Set[1,2,3])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants