开发者社区 > 云原生 > 正文

Dubbo支持多个重载方法调用吗?

com.alibaba.dubbo.remoting.RemotingException: java.lang.IllegalStateException: Not unique method for method name(searchUserInfo) in class(com.companyname.groupname.DemoService), find 2 methods. java.lang.IllegalStateException: Not unique method for method name(searchUserInfo) in class(com.companyname.groupname.DemoService), find 2 methods. at com.alibaba.dubbo.common.utils.ReflectUtils.findMethodByMethodSignature(ReflectUtils.java:808) at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:62) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:108) at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:39) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:108) at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:108) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:93) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:89) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received$original$NqbVQaNw(HeaderExchangeHandler.java:203) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received$original$NqbVQaNw$accessor$ThxnG4m7(HeaderExchangeHandler.java) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler$auxiliary$f7hylC38.call(Unknown Source) at com.pdd.service.ptracer.boot.api.injector.enhance.InstanceMethodEnhancer.enhance(InstanceMethodEnhancer.java:61) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java) at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:52) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

结果: 调用远程方法未知异常. 方法名: $invoke, 调用接口: [com.alibaba.dubbo.rpc.service.GenericService]的方法: [$invoke]失败. 从注册中心: [st1-tdubbo-zk-a-1.host.xxxxx.net:2181]上的的消费者: [152.4.231.10]重试调用提供者[152.4.231.10:45925]1次, 当前dubbo版本[2.15.0.RELEASE]

原提问者GitHub用户daidai21

展开
收起
大圣东游 2023-05-11 19:11:55 182 0
1 条回答
写回答
取消 提交回答
  • dubbo 2.15? 似乎没有这个版本阿? 看堆栈打印的是 alibaba 的包名,至少是2.7之前的版本,可能不支持,但目前2.7和3.0都是支持重载调用的

    原回答者GitHub用户EarthChen

    2023-05-12 11:04:05
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
Dubbo开源现状与2.7规划 立即下载
Dubbo分布式服务治理实战 立即下载
《Dubbo 3.0 前瞻》 立即下载