apache / apache/incubator-seata

2.0.0+dubbo2.7.15+tcc模式消费者端报错

Open
#6,437 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.

### Ⅰ. Issue Description

### Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

```
Just paste your stack trace here!
```
Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodException: org.apache.dubbo.common.bytecode.ClassGenerator$DC.prepare(io.seata.rm.tcc.api.BusinessActionContext, int)
at io.seata.rm.tcc.interceptor.TccActionInterceptorHandler.lambda$parseAnnotation$0(TccActionInterceptorHandler.java:115)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at io.seata.rm.tcc.interceptor.TccActionInterceptorHandler.parseAnnotation(TccActionInterceptorHandler.java:95)
at io.seata.rm.tcc.interceptor.TccActionInterceptorHandler.doInvoke(TccActionInterceptorHandler.java:63)
at io.seata.integration.tx.api.interceptor.handler.AbstractProxyInvocationHandler.invoke(AbstractProxyInvocationHandler.java:20)
at io.seata.spring.annotation.AdapterSpringSeataInterceptor.invoke(AdapterSpringSeataInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at org.apache.dubbo.common.bytecode.proxy0$$EnhancerBySpringCGLIB$$42e9b4b3.prepare()
at io.seata.tcc.springboot.dubbo.service.TccTransactionService.doTransactionCommit(TccTransactionService.java:31)
at io.seata.tcc.springboot.dubbo.service.TccTransactionService$$FastClassBySpringCGLIB$$fc4de775.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at io.seata.spring.annotation.AdapterInvocationWrapper.proceed(AdapterInvocationWrapper.java:41)
at io.seata.integration.tx.api.interceptor.handler.GlobalTransactionalInterceptorHandler$2.execute(GlobalTransactionalInterceptorHandler.java:185)
at io.seata.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:113)
at io.seata.integration.tx.api.interceptor.handler.GlobalTransactionalInterceptorHandler.handleGlobalTransaction(GlobalTransactionalInterceptorHandler.java:182)
at io.seata.integration.tx.api.interceptor.handler.GlobalTransactionalInterceptorHandler.doInvoke(GlobalTransactionalInterceptorHandler.java:151)
at io.seata.integration.tx.api.interceptor.handler.AbstractProxyInvocationHandler.invoke(AbstractProxyInvocationHandler.java:20)
at io.seata.spring.annotation.AdapterSpringSeataInterceptor.invoke(AdapterSpringSeataInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at io.seata.tcc.springboot.dubbo.service.TccTransactionService$$EnhancerBySpringCGLIB$$c2f8a418.doTransactionCommit()
at io.seata.tcc.springboot.dubbo.starter.SpringbootTccTransactionApplication.transactionCommitDemo(SpringbootTccTransactionApplication.java:56)
at io.seata.tcc.springboot.dubbo.starter.SpringbootTccTransactionApplication.main(SpringbootTccTransactionApplication.java:47)
Caused by: java.lang.NoSuchMethodException: org.apache.dubbo.common.bytecode.ClassGenerator$DC.prepare(io.seata.rm.tcc.api.BusinessActionContext, int)
at java.lang.Class.getMethod(Class.java:1786)
at io.seata.rm.tcc.interceptor.TccActionInterceptorHandler.lambda$parseAnnotation$0(TccActionInterceptorHandler.java:107)
... 28 more

### Ⅲ. Describe what you expected to happen
![image](https://github.com/apache/incubator-seata/assets/39424591/c59940bc-dde7-479c-ae74-2c68d4ce1520)
image

### Ⅳ. How to reproduce it (as minimally and precisely as possible)
https://gitee.com/seata-io/seata-samples/tree/master/tcc/springboot-tcc-sample
1. xxx
2. xxx
3. xxx

Minimal yet complete reproducer code (or URL to code):
测试用例tcc/springboot-tcc-sample

### Ⅴ. Anything else we need to know?

### Ⅵ. Environment:

- JDK version(e.g. `java -version`): 1.8
- Seata client/server version: 2.0.0
- Database version:
- OS(e.g. `uname -a`):
- Others:dubbo 2.7.15

Contributor guide

Open the contributing guide

Research direction

Start with the tcc/springboot-tcc-sample reproducer and the stack trace, then inspect TccActionInterceptorHandler.java around parseAnnotation at lines 95-115 and the Dubbo 2.7.15-generated ClassGenerator method. Reproduce the consumer-side failure with JDK 1.8, Seata 2.0.0, and Dubbo 2.7.15; done means the sample's TCC transaction completes without the NoSuchMethodException.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.