apache / apache/incubator-seata-samples
dubbo-tcc-sample: "Failed to invoke the method prepare..."
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
Failed to invoke the method prepare in the service io.seata.samples.tcc.dubbo.action.TccActionOne.
执行DubboTccTransactionStarter时,直接报这个错,具体堆栈如下,有没有同学遇到的,怎么可能找不到方法呐;服务都注册成功了的;
Exception in thread "main" org.apache.dubbo.rpc.RpcException: Failed to invoke the method prepare in the service io.seata.samples.tcc.dubbo.action.TccActionOne. Tried 3 times of the providers [172.19.34.37:20880] (1/1) from the registry 127.0.0.1:2181 on the consumer 172.19.34.37 using the dubbo version 2.7.0. Last error is: com.alibaba.dubbo.rpc.Invoker.invoke(Lcom/alibaba/dubbo/rpc/Invocation;)Lcom/alibaba/dubbo/rpc/Result;
at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:111)
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:241)
at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75)
at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:57)
at org.apache.dubbo.common.bytecode.proxy0.prepare(proxy0.java)
at org.apache.dubbo.common.bytecode.proxy0$$FastClassBySpringCGLIB$$c197671e.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at io.seata.rm.tcc.interceptor.ActionInterceptorHandler.proceed(ActionInterceptorHandler.java:84)
at io.seata.spring.tcc.TccActionInterceptor.invoke(TccActionInterceptor.java:83)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at org.apache.dubbo.common.bytecode.proxy0$$EnhancerBySpringCGLIB$$39235190.prepare()
at io.seata.samples.tcc.dubbo.service.TccTransactionService.doTransactionCommit(TccTransactionService.java:32)
at io.seata.samples.tcc.dubbo.service.TccTransactionService$$FastClassBySpringCGLIB$$6f83e6a9.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at io.seata.spring.annotation.GlobalTransactionalInterceptor$1.execute(GlobalTransactionalInterceptor.java:109)
at io.seata.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:64)
at io.seata.spring.annotation.GlobalTransactionalInterceptor.handleGlobalTransaction(GlobalTransactionalInterceptor.java:106)
at io.seata.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:83)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at io.seata.samples.tcc.dubbo.service.TccTransactionService$$EnhancerBySpringCGLIB$$99182a.doTransactionCommit()
at io.seata.samples.tcc.dubbo.starter.DubboTccTransactionStarter.transactionCommitDemo(DubboTccTransactionStarter.java:56)
at io.seata.samples.tcc.dubbo.starter.DubboTccTransactionStarter.main(DubboTccTransactionStarter.java:47)
Caused by: java.lang.NoSuchMethodError: com.alibaba.dubbo.rpc.Invoker.invoke(Lcom/alibaba/dubbo/rpc/Invocation;)Lcom/alibaba/dubbo/rpc/Result;
at io.seata.integration.dubbo.alibaba.AlibabaDubboTransactionPropagationFilter.invoke(AlibabaDubboTransactionPropagationFilter.java:43)
at com.alibaba.dubbo.rpc.Filter.invoke(Filter.java:29)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73)
at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:88)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73)
at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:49)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73)
at org.apache.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:54)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73)
at org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77)
at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:80)
... 27 more
Contributor guide
Research direction
Start by reproducing DubboTccTransactionStarter and inspect TccTransactionService.java, DubboTccTransactionStarter.java, and AlibabaDubboTransactionPropagationFilter.java. Compare the Dubbo invocation types used by the sample and its dependencies, then verify that the prepare call completes without NoSuchMethodError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100