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

系统启动后的一段时间内,provider错乱

环境信息

Dubbo version: 3.0.12 Operating System version: windows10 Java version: 11

步骤重现

1、使用zk作为注册中心

2、使用org.apache.dubbo:dubbo-spring-boot-starter

实际执行情况

系统启动的15s内,provider错乱 具体表现可见下方日志 调用com.alibaba.rdc.basic.system.dict.DictProvider的findAll方法 报错却说找不到UserProvider的findAll

2022-10-09 17:22:08.162 ERROR 20140 --- [ XNIO-2 task-1] c.l.rdc.core.dubbo.DubboExceptionFilter : [DUBBO] Got unchecked and undeclared exception which called by null. service: com.alibaba.rdc.basic.system.dict.DictProvider, method: findAll, exception: org.apache.dubbo.rpc.RpcException: Failed to invoke remote method: findAll, provider: DefaultServiceInstance{serviceName='demo-basic', host='192.168.1.100', port=20881, enabled=true, healthy=true, metadata={dubbo.endpoints=[{"port":20881,"protocol":"dubbo"}], dubbo.metadata-service.url-params={"connections":"1","timeout":"5000","version":"1.0.0","dubbo":"2.0.2","release":"3.0.12","side":"provider","port":"20881","protocol":"dubbo"}, dubbo.metadata.revision=86167ff15d98ad75c64ec137880be22b, dubbo.metadata.storage-type=local}}, cause: org.apache.dubbo.remoting.RemotingException: org.apache.dubbo.rpc.RpcException: Failed to invoke remote proxy method findAll to registry://localhost:2181/org.apache.dubbo.registry.RegistryService?application=demo-basic&dubbo=2.0.2&group=demo&logger=slf4j&pid=3752&qos.enable=false&registry=zookeeper&release=3.0.12&simplified=true&timestamp=1665307305713, cause: Not found method "findAll" in class com.alibaba.rdc.basic.system.user.UserProvider. org.apache.dubbo.rpc.RpcException: Failed to invoke remote proxy method findAll to registry://localhost:2181/org.apache.dubbo.registry.RegistryService?application=demo-basic&dubbo=2.0.2&group=demo&logger=slf4j&pid=3752&qos.enable=false&registry=zookeeper&release=3.0.12&simplified=true&timestamp=1665307305713, cause: Not found method "findAll" in class com.alibaba.rdc.basic.system.user.UserProvider. at org.apache.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:134) at org.apache.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:55) at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) at org.apache.dubbo.rpc.filter.ClassLoaderCallbackFilter.invoke(ClassLoaderCallbackFilter.java:38) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:77) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:44) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:99) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at com.alibaba.rdc.core.dubbo.DubboExceptionFilter.invoke(DubboExceptionFilter.java:26) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:191) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:54) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.rpc.filter.ProfilerServerFilter.invoke(ProfilerServerFilter.java:56) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:131) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:326) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CallbackRegistrationInvoker.invoke(FilterChainBuilder.java:193) at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:151) at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:100) at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:175) at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:59) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: org.apache.dubbo.common.bytecode.NoSuchMethodException: Not found method "findAll" in class com.alibaba.rdc.basic.system.user.UserProvider. at com.alibaba.rdc.basic.system.user.UserProviderDubboWrap3.invokeMethod(UserProviderDubboWrap3.java) at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:71) at org.apache.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:99) ... 32 more , dubbo version: 3.0.12, current host: 192.168.1.100

原提问者GitHub用户cwt9562

展开
收起
大圣东游 2023-05-11 16:41:12 609 0
1 条回答
写回答
取消 提交回答
  • 是不是有部分机器发布的 com.alibaba.rdc.basic.system.user.UserProvider 接口不存在 findAll 方法。

    Dubbo 做服务发现的时候是以接口为粒度的,如果添加接口后没有全部机器都部署就调用时会导致找不到方法的问题,因为 Dubbo 作为消费端的时候是不知道服务端具体真的发了多少个方法的,只知道发了某个服务。

    原回答者GitHub用户AlbumenJ

    2023-05-12 10:29:36
    赞同 展开评论 打赏

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

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载