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

com.alibaba.escar.core.exception.TransactionExcept

If the @GlobalTransactional is added to the sample code, the following error will be reported. If the @GlobalTransactional annotation is not added, it can be executed normally. What is the reason? // 样例代码中如果加上@GlobalTransactional就报下面的错误,如果不加@GlobalTransactional注解则可以正常执行,请问是啥原因?

2019-01-11 15:57:15,059 [FESCAR] [main] INFO com.alibaba.fescar.tm.dubbo.BusinessService - Main business begin ... xid: null 2019-01-11 15:57:27,709 [FESCAR] [main] DEBUG com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting - offer message: com.alibaba.fescar.core.protocol.transaction.GlobalBeginRequest@38a6964d 2019-01-11 15:57:57,712 [FESCAR] [main] ERROR com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting - wait response error:cost 30004 ms,ip:127.0.0.1:8091,request:com.alibaba.fescar.core.protocol.transaction.GlobalBeginRequest@38a6964d 2019-01-11 15:57:57,749 [FESCAR] [main] WARN com.alibaba.fescar.tm.api.DefaultFailureHandlerImpl - Failed to begin transaction. com.alibaba.fescar.core.exception.TransactionException: java.util.concurrent.TimeoutException: cost 30004 ms at com.alibaba.fescar.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:100) at com.alibaba.fescar.tm.DefaultTransactionManager.begin(DefaultTransactionManager.java:65) at com.alibaba.fescar.tm.api.DefaultGlobalTransaction.begin(DefaultGlobalTransaction.java:82) at com.alibaba.fescar.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:40) at com.alibaba.fescar.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:51) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) at com.alibaba.fescar.tm.dubbo.impl.BusinessServiceImpl$$EnhancerByCGLIB$$e0bc343.purchase() at com.alibaba.fescar.tm.dubbo.impl.BusinessServiceImpl.main(BusinessServiceImpl.java:62) Caused by: java.util.concurrent.TimeoutException: cost 30004 ms at com.alibaba.fescar.core.protocol.MessageFuture.get(MessageFuture.java:46) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequest(AbstractRpcRemoting.java:265) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequestWithResponse(AbstractRpcRemoting.java:194) at com.alibaba.fescar.core.rpc.netty.TmRpcClient.sendMsgWithResponse(TmRpcClient.java:196) at com.alibaba.fescar.core.rpc.netty.TmRpcClient.sendMsgWithResponse(TmRpcClient.java:216) at com.alibaba.fescar.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:98) ... 8 common frames omitted Exception in thread "main" java.lang.reflect.UndeclaredThrowableException at com.alibaba.fescar.tm.dubbo.impl.BusinessServiceImpl$$EnhancerByCGLIB$$e0bc343.purchase() at com.alibaba.fescar.tm.dubbo.impl.BusinessServiceImpl.main(BusinessServiceImpl.java:62) Caused by: com.alibaba.fescar.core.exception.TransactionException: java.util.concurrent.TimeoutException: cost 30004 ms at com.alibaba.fescar.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:100) at com.alibaba.fescar.tm.DefaultTransactionManager.begin(DefaultTransactionManager.java:65) at com.alibaba.fescar.tm.api.DefaultGlobalTransaction.begin(DefaultGlobalTransaction.java:82) at com.alibaba.fescar.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:40) at com.alibaba.fescar.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:51) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) ... 2 more Caused by: java.util.concurrent.TimeoutException: cost 30004 ms at com.alibaba.fescar.core.protocol.MessageFuture.get(MessageFuture.java:46) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequest(AbstractRpcRemoting.java:265) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequestWithResponse(AbstractRpcRemoting.java:194) at com.alibaba.fescar.core.rpc.netty.TmRpcClient.sendMsgWithResponse(TmRpcClient.java:196) at com.alibaba.fescar.core.rpc.netty.TmRpcClient.sendMsgWithResponse(TmRpcClient.java:216) at com.alibaba.fescar.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:98) ... 8 more

原提问者GitHub用户csfrez c

展开
收起
学习娃 2023-06-14 16:51:47 132 0
1 条回答
写回答
取消 提交回答
  • TM与TC(服务器)通话时出现问题,请求已发出,但响应超时。

    原回答者GitHub用户sharajava

    2023-06-14 17:25:30
    赞同 展开评论 打赏
问答分类:
问答地址:

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

相关电子书

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