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

使用自定义类型数组参数报错: argument type mismatch #1019

Open
javeme opened this issue Feb 13, 2021 · 3 comments
Open

使用自定义类型数组参数报错: argument type mismatch #1019

javeme opened this issue Feb 13, 2021 · 3 comments
Labels
remind To be further discussed

Comments

@javeme
Copy link

javeme commented Feb 13, 2021

Describe the bug

RPC服务的方法中,参数使用自定义类型数组时(且自定义类型是接口interface),客户端调用后报错: argument type mismatch

Expected behavior

希望可以使用任何类型的数组作为参数。比如有interface Id,可使用Id[]作为方法参数。

Actual behavior

服务端调用业务方法时,Object[]无法转换为Id[]而报错:
image

更多记录信息可参考:https://blog.csdn.net/javeme/article/details/113802090

Steps to reproduce

Minimal yet complete reproducer code (or GitHub URL to code)

public interface CacheNotifier {
    void invalid2(Id[] ids);
}

public interface Id {
    ...
}

public void test() {
    CacheNotifier proxy = consumerConfig.setInterfaceId(CacheNotifier.class).refer();
    proxy.invalid2(new Id[]{new LongId(1)});
}

Environment

  • SOFARPC version: 5.7.6
  • JVM version (e.g. java -version): 8
  • OS version (e.g. uname -a): Mac
  • Maven version:
  • IDE version: eclipse
@stale
Copy link

stale bot commented Feb 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Feb 8, 2022
@EvenLjj EvenLjj removed the wontfix This will not be worked on label Feb 9, 2022
@stale
Copy link

stale bot commented Apr 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 10, 2022
@EvenLjj EvenLjj added the remind To be further discussed label Apr 10, 2022
@stale stale bot removed the wontfix This will not be worked on label Apr 10, 2022
@sofastack-bot sofastack-bot bot added the wontfix This will not be worked on label Apr 10, 2022
@EvenLjj EvenLjj removed the wontfix This will not be worked on label Apr 10, 2022
@javeme
Copy link
Author

javeme commented Apr 10, 2022

@EvenLjj 该问题表现的原因是使用了Object的Deserializer来反序列化Id,希望能提供一些背景/上下文:为何Interface的反序列化器要使用Deserializer而非Deserializer?

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

No branches or pull requests

2 participants