Open huzhanqiu opened 5 years ago
版本信息: ByteTcc 0.5.7 springboot 2.1.6 报错信息: 2019-10-21 12:36:30.148 [pool-1-thread-1] ERROR o.b.b.s.serialize.XAResourceDeserializerImpl - can not find a matching xa-resource(beanId= 10.0.75.1:JQXXH-BASIC:8084)!
instanceId的格式应该是: ${ip}:${service-name}:${port}。
如果没有其他的异常,数据没有不一致。这个错误可以忽略。byteTCC恢复时优先从spring容器中找响应的数据源资源,远程instanceId肯定是找不出来的,所以日志中会有这么一行错误信息。
当然,springboot因为它没有响应的服务发现机制,所以可能会相对特殊一点。如果存在数据不一致的情况,提供一下重现的步骤吧,我看看是怎么回事。
这个是调用的日志:
2019-10-21 15:11:38.638 [http-nio-8085-exec-6] INFO com.jzd.jqxxhjqjsry.config.log.WebLogAspect - ========================================== Start ==========================================
2019-10-21 15:11:38.638 [http-nio-8085-exec-6] INFO com.jzd.jqxxhjqjsry.config.log.WebLogAspect - URL : http://localhost:8085/jqjsry/api/jqbgjltest/addJqBgjl
2019-10-21 15:11:38.638 [http-nio-8085-exec-6] INFO com.jzd.jqxxhjqjsry.config.log.WebLogAspect - Description : 新增警犬变更记录测试
2019-10-21 15:11:38.638 [http-nio-8085-exec-6] INFO com.jzd.jqxxhjqjsry.config.log.WebLogAspect - HTTP Method : POST
2019-10-21 15:11:38.638 [http-nio-8085-exec-6] INFO com.jzd.jqxxhjqjsry.config.log.WebLogAspect - Class Method : com.jzd.jqxxhjqjsry.controller.sygl.bgjl.TbJqBgjlServiceController.addJqBgjl
2019-10-21 15:11:38.639 [http-nio-8085-exec-6] INFO com.jzd.jqxxhjqjsry.config.log.WebLogAspect - IP : 0:0:0:0:0:0:0:1
2019-10-21 15:11:38.639 [http-nio-8085-exec-6] INFO com.jzd.jqxxhjqjsry.config.log.WebLogAspect - Request Args : [[TbJqBgjl(jlbh=, jqId=11, bgrq=null, yfydw=, yxdy=, yxdyRybh=, ylb=, bgyy=, xfydw=, xxdy=, xxdyRybh=, xlb=, bz=1, lrr=, lrrsfzh=, lrsj=null, yxx=1, xgr=, xgrsfzh=, xgdw=, xgsj=null, lrdw=, lrdwmc=, xgdwmc=, qm=, eh=)]]
2019-10-21 15:11:38.639 [http-nio-8085-exec-6] INFO org.bytesoft.bytetcc.CompensableManagerImpl - 5aabcb9aff00155d0071151bbc0cb07e| compensable transaction begin!
2019-10-21 15:11:38.639 [http-nio-8085-exec-6] INFO org.bytesoft.bytejta.TransactionCoordinator - 5aabcb9aff00155d0071151bbc0cb07e> begin-participant
2019-10-21 15:11:38.639 [http-nio-8085-exec-6] INFO org.bytesoft.bytetcc.CompensableTransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e| register compensable service: 5aabcb9aff00155d0071151bbc0cb07e.
2019-10-21 15:11:38.643 [hystrix-jqxxh-basic-10] INFO org.bytesoft.bytetcc.CompensableTransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e| enlist remote resource: 10.0.75.1:JQXXH-BASIC:8084.
2019-10-21 15:11:38.661 [http-nio-8085-exec-6] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e> enlist: xares= xa-res-archive[descriptor: local-xa-resource[dataSource]], branch= 5aabcb9a1500155d0071151e093bebbb, flags: 0
2019-10-21 15:11:40.160 [http-nio-8085-exec-6] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e> delist: xares= xa-res-archive[descriptor: local-xa-resource[dataSource]], branch= 5aabcb9a1500155d0071151e093bebbb, flags= 67108864
2019-10-21 15:11:40.161 [http-nio-8085-exec-6] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e> rollback-participant start
2019-10-21 15:11:40.171 [http-nio-8085-exec-6] INFO org.bytesoft.bytejta.resource.XATerminatorOptd - 5aabcb9aff00155d0071151bbc0cb07e> rollback: xares= xa-res-archive[descriptor: local-xa-resource[dataSource]], branch= 5aabcb9a1500155d0071151e093bebbb
2019-10-21 15:11:40.171 [http-nio-8085-exec-6] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e> rollback-participant complete successfully
2019-10-21 15:11:40.171 [http-nio-8085-exec-6] INFO org.bytesoft.bytetcc.CompensableTransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e| The operation in try phase is rolled back, so the cancel operation is ignored, compensable service: 5aabcb9aff00155d0071151bbc0cb07e.
2019-10-21 15:11:40.172 [http-nio-8085-exec-6] WARN o.s.h.c.xml.MappingJackson2XmlHttpMessageConverter - Failed to evaluate Jackson deserialization for type [[simple type, class void]]: com.fasterxml.jackson.databind.JsonMappingException: Internal error: can't find deserializer for void
2019-10-21 15:11:40.172 [http-nio-8085-exec-6] WARN o.s.h.c.json.MappingJackson2HttpMessageConverter - Failed to evaluate Jackson deserialization for type [[simple type, class void]]: com.fasterxml.jackson.databind.JsonMappingException: Internal error: can't find deserializer for void
2019-10-21 15:11:40.176 [http-nio-8085-exec-6] ERROR org.bytesoft.bytetcc.CompensableTransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e| error occurred while cancelling remote branch: xa-res-archive[descriptor: <remote-resource| id= 10.0.75.1:JQXXH-BASIC:8084>], the remote branch is unreachable!
javax.transaction.xa.XAException: null
at org.bytesoft.bytetcc.supports.springcloud.SpringCloudCoordinator.invokePostCoordinator(SpringCloudCoordinator.java:132)
at org.bytesoft.bytetcc.supports.springcloud.SpringCloudCoordinator.invoke(SpringCloudCoordinator.java:83)
at com.sun.proxy.$Proxy266.rollback(Unknown Source)
at org.bytesoft.bytejta.supports.resource.RemoteResourceDescriptor.rollback(RemoteResourceDescriptor.java:120)
at org.bytesoft.transaction.archive.XAResourceArchive.rollback(XAResourceArchive.java:109)
at org.bytesoft.bytetcc.CompensableTransactionImpl.fireRemoteParticipantCancel(CompensableTransactionImpl.java:613)
at org.bytesoft.bytetcc.CompensableTransactionImpl.fireRollback(CompensableTransactionImpl.java:506)
at org.bytesoft.bytetcc.CompensableTransactionImpl.rollback(CompensableTransactionImpl.java:445)
at org.bytesoft.bytetcc.CompensableManagerImpl.fireCompensableRollback(CompensableManagerImpl.java:473)
at org.bytesoft.bytetcc.CompensableManagerImpl.invokeCompensableRollback(CompensableManagerImpl.java:688)
at org.bytesoft.bytetcc.CompensableManagerImpl.compensableRollback(CompensableManagerImpl.java:654)
at org.bytesoft.bytetcc.TransactionManagerImpl.rollback(TransactionManagerImpl.java:147)
at org.bytesoft.bytetcc.UserCompensableImpl.rollback(UserCompensableImpl.java:251)
at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:1061)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:838)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:812)
at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:552)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:299)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor$AspectJoinpoint.proceed(CompensableMethodInterceptor.java:295)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor.execute(CompensableMethodInterceptor.java:181)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor.invoke(CompensableMethodInterceptor.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
at com.jzd.jqxxhjqjsry.config.log.WebLogAspect.doAround(WebLogAspect.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at com.jzd.jqxxhjqjsry.controller.sygl.bgjl.TbJqBgjlServiceController$$EnhancerBySpringCGLIB$$3061f2d9.addJqBgjl(
org.springframework.transaction.TransactionSystemException: JTA failure on rollback; nested exception is org.bytesoft.transaction.RollbackRequiredException
at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:1077)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:838)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:812)
at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:552)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:299)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor$AspectJoinpoint.proceed(CompensableMethodInterceptor.java:295)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor.execute(CompensableMethodInterceptor.java:181)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor.invoke(CompensableMethodInterceptor.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
at com.jzd.jqxxhjqjsry.config.log.WebLogAspect.doAround(WebLogAspect.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at com.jzd.jqxxhjqjsry.controller.sygl.bgjl.TbJqBgjlServiceController$$EnhancerBySpringCGLIB$$3061f2d9.addJqBgjl(
org.springframework.transaction.TransactionSystemException: JTA failure on rollback; nested exception is org.bytesoft.transaction.RollbackRequiredException
at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:1077)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:838)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:812)
at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:552)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:299)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor$AspectJoinpoint.proceed(CompensableMethodInterceptor.java:295)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor.execute(CompensableMethodInterceptor.java:181)
at org.bytesoft.bytetcc.supports.spring.CompensableMethodInterceptor.invoke(CompensableMethodInterceptor.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
at com.jzd.jqxxhjqjsry.config.log.WebLogAspect.doAround(WebLogAspect.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at com.jzd.jqxxhjqjsry.controller.sygl.bgjl.TbJqBgjlServiceController$$EnhancerBySpringCGLIB$$3061f2d9.addJqBgjl(
2019-10-21 15:11:40.151 [http-nio-8084-exec-3] INFO org.bytesoft.bytejta.resource.XATerminatorOptd - 5aabcba0dd00155d00711515147bf8f7> commit: xares= xa-res-archive[descriptor: local-xa-resource[dataSource]], branch= 5aabcba0de00155d00711517408307bf, opc= false 2019-10-21 15:11:40.153 [http-nio-8084-exec-3] INFO org.bytesoft.bytetcc.CompensableTransactionImpl - 5aabcb9aff00155d0071151bbc0cb07e| try: identifier= 5aabcb9aff00155d0071151bbc0cb07e, resourceKey= dataSource, resourceXid= 1207-5aabcba0dd00155d00711515147bf8f7-5aabcba0de00155d00711517408307bf. 2019-10-21 15:11:40.153 [http-nio-8084-exec-3] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcba0dd00155d00711515147bf8f7> commit-participant complete successfully 2019-10-21 15:12:30.246 [pool-1-thread-1] DEBUG org.bytesoft.bytetcc.TransactionRecoveryImpl - transaction-recovery: total= 13, success= 0 2019-10-21 15:13:14.162 [http-nio-8084-exec-8] DEBUG s.d.s.w.PropertySourcedRequestMappingHandlerMapping - looking up handler for path: /api/account/accountByFeignNew 2019-10-21 15:13:14.163 [http-nio-8084-exec-8] INFO org.bytesoft.bytetcc.CompensableCoordinator - 5aabcd381e00155d007115211db55c98| compensable transaction begin! 2019-10-21 15:13:14.165 [http-nio-8084-exec-8] DEBUG io.lettuce.core.RedisChannelHandler - dispatching command AsyncCommand [type=GET, output=ValueOutput [output=null, error='null'], commandType=io.lettuce.core.protocol.Command] 2019-10-21 15:13:18.633 [http-nio-8084-exec-9] DEBUG s.d.s.w.PropertySourcedRequestMappingHandlerMapping - looking up handler for path: /api/tb-xt-rz-dl-test/insertDlrz 2019-10-21 15:13:18.635 [http-nio-8084-exec-9] INFO org.bytesoft.bytejta.TransactionCoordinator - 5aabcd4afb00155d007115196bc1602d> begin-participant 2019-10-21 15:13:18.635 [http-nio-8084-exec-9] INFO org.bytesoft.bytetcc.CompensableTransactionImpl - 5aabcd381e00155d007115211db55c98| register compensable service: 5aabcd381e00155d007115211db55c98. 2019-10-21 15:13:18.635 [http-nio-8084-exec-9] DEBUG c.b.dynamic.datasource.DynamicRoutingDataSource - 从默认数据源中返回数据 2019-10-21 15:13:18.651 [http-nio-8084-exec-9] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcd4afb00155d007115196bc1602d> enlist: xares= xa-res-archive[descriptor: local-xa-resource[dataSource]], branch= 5aabcd4a0b00155d0071151b7b93c014, flags: 0 2019-10-21 15:13:18.652 [http-nio-8084-exec-9] DEBUG c.b.m.extension.parsers.BlockAttackSqlParser - Original SQL: INSERT INTO TB_XT_RZ_DL ( DLRZID ) VALUES ( ? ) 2019-10-21 15:13:18.652 [http-nio-8084-exec-9] DEBUG c.b.m.extension.parsers.BlockAttackSqlParser - parser sql: INSERT INTO TB_XT_RZ_DL (DLRZID) VALUES (?) 2019-10-21 15:13:18.653 [http-nio-8084-exec-9] DEBUG c.jzd.jqxxhbasic.mapper.sys.TbXtRzDlMapper.insert - ==> Preparing: INSERT INTO TB_XT_RZ_DL (DLRZID) VALUES (?) 2019-10-21 15:13:18.653 [http-nio-8084-exec-9] DEBUG c.jzd.jqxxhbasic.mapper.sys.TbXtRzDlMapper.insert - ==> Parameters: 123(String) 2019-10-21 15:13:18.672 [http-nio-8084-exec-9] DEBUG c.jzd.jqxxhbasic.mapper.sys.TbXtRzDlMapper.insert - <== Updates: 1 2019-10-21 15:13:18.672 [http-nio-8084-exec-9] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcd4afb00155d007115196bc1602d> delist: xares= xa-res-archive[descriptor: local-xa-resource[dataSource]], branch= 5aabcd4a0b00155d0071151b7b93c014, flags= 67108864 2019-10-21 15:13:18.672 [http-nio-8084-exec-9] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcd4afb00155d007115196bc1602d> commit-participant start 2019-10-21 15:13:18.713 [http-nio-8084-exec-9] DEBUG org.bytesoft.bytejta.supports.jdbc.LocalXAResource - Error occurred while getting schema of java.sql.Connection! 2019-10-21 15:13:18.733 [http-nio-8084-exec-9] DEBUG org.bytesoft.bytejta.supports.jdbc.LocalXAResource - Error occurred while ending local-xa-resource: ORA-00942: 表或视图不存在
2019-10-21 15:13:18.753 [http-nio-8084-exec-9] INFO org.bytesoft.bytejta.resource.XATerminatorOptd - 5aabcd4afb00155d007115196bc1602d> commit: xares= xa-res-archive[descriptor: local-xa-resource[dataSource]], branch= 5aabcd4a0b00155d0071151b7b93c014, opc= false 2019-10-21 15:13:18.754 [http-nio-8084-exec-9] INFO org.bytesoft.bytetcc.CompensableTransactionImpl - 5aabcd381e00155d007115211db55c98| try: identifier= 5aabcd381e00155d007115211db55c98, resourceKey= dataSource, resourceXid= 1207-5aabcd4afb00155d007115196bc1602d-5aabcd4a0b00155d0071151b7b93c014. 2019-10-21 15:13:18.754 [http-nio-8084-exec-9] INFO org.bytesoft.bytejta.TransactionImpl - 5aabcd4afb00155d007115196bc1602d> commit-participant complete successfully 2019-10-21 15:13:30.342 [pool-1-thread-1] DEBUG org.bytesoft.bytetcc.TransactionRecoveryImpl - transaction-recovery: total= 13, success= 0 2019-10-21 15:13:33.455 [AsyncResolver-bootstrap-executor-0] INFO c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration 2019-10-21 15:14:30.345 [pool-1-thread-1] DEBUG org.bytesoft.bytetcc.TransactionRecoveryImpl - transaction-recovery: total= 13, success= 0
发现被调用服务没有走cancellableKey 定义的impl ,下面是具体回滚代码
@Slf4j @Service("tbXtRzDlCancel") public class TbXtRzDlServiceCancelImpl extends ServiceImpl<TbXtRzDlMapper, TbXtRzDl> implements ITbXtRzDlTestService { @Resource private TbXtRzDlMapper tbXtRzDlMapper; @Override @Transactional public TransportEntity insertDlrz(@RequestParam("tbXtRzDl") String tbXtRzDl) { TransportEntity transportEntity=new TransportEntity(); transportEntity.setSfcg(false); transportEntity.setCode(500); transportEntity.setCzsj(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); String dlid=JSON.parseObject(tbXtRzDl,TbXtRzDl.class).getDlrzid(); int deleteCount = tbXtRzDlMapper.deleteById(dlid); log.error(dlid,deleteCount); transportEntity.setErrMsg("插入登录日志失败"); return transportEntity; } }
日志显示远程分支10.0.75.1:JQXXH-BASIC:8084不可达,如果这个ip和端口没有问题(没有配错并且服务也正常启动着)的话,那么就考虑是不是你业务系统做了什么拦截操作,又或者,有没有设置该分支上的业务系统设置context-path。
另外,byteTCC不支持动态数据源,看你日志打印了这样的日志:‘c.b.dynamic.datasource.DynamicRoutingDataSource - 从默认数据源中返回数据’,这样是有问题的。
谢谢您的回复,我找到问题了,我配置了servlet.context-path,连接10.0.75.1:JQXXH-BASIC:8084是对的,但是没有拼接上servlet.context-path,导致连接不上。
请问怎么在yml里制定instanceId