dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

GenericService Invoke Don't Support Subclasses

Open Piean opened this issue 6 years ago • 2 comments

Environment

  • Dubbo version: 2.7.5
  • Operating System version: win10
  • Java version: 1.8

Steps to reproduce this issue

  1. class A extends B
  2. hello(B b)
  3. 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?

Piean avatar May 07 '20 06:05 Piean

dubbo的兼容包是没有经过生产环境检验的,事实上我们做了很多补全才完成了升级。你可以参考https://github.com/open-wrapper/dubbo-wrapper

CodeIngL avatar Jul 08 '20 10:07 CodeIngL

Try it with the latest version, if you still have problems, you can reopen the issue.

CrazyHZM avatar Dec 23 '21 12:12 CrazyHZM