环境信息
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®istry=zookeeper&release=3.0.12&simplified=true×tamp=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®istry=zookeeper&release=3.0.12&simplified=true×tamp=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
是不是有部分机器发布的 com.alibaba.rdc.basic.system.user.UserProvider 接口不存在 findAll 方法。
Dubbo 做服务发现的时候是以接口为粒度的,如果添加接口后没有全部机器都部署就调用时会导致找不到方法的问题,因为 Dubbo 作为消费端的时候是不知道服务端具体真的发了多少个方法的,只知道发了某个服务。
原回答者GitHub用户AlbumenJ
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。