GenericService Invoke Don't Support Subclasses
Environment
- Dubbo version: 2.7.5
- Operating System version: win10
- Java version: 1.8
Steps to reproduce this issue
- class A extends B
- hello(B b)
- genericService.$invoke("hello", "A", new Object[] {a})
Expected
invoke success
Actually happens
throw the NoSuchMethodException in org.apache.dubbo.common.utils.ReflectUtils at line 925
exception trace:
org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:144)\r\n\tat org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81)\r\n\tat org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)\r\n\tat org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81)\r\n\tat org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41)\r\n\tat org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81)\r\n\tat org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:150)\r\n\tat org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:100)\r\n\tat org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:175)\r\n\tat org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)\r\n\tat org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\nCaused by: java.lang.NoSuchMethodException
Can do some compatibility and optimization?
dubbo的兼容包是没有经过生产环境检验的,事实上我们做了很多补全才完成了升级。你可以参考https://github.com/open-wrapper/dubbo-wrapper
Try it with the latest version, if you still have problems, you can reopen the issue.