Home > Back-end >  Use LCN solve distributed transaction error tx - the manager is not connected
Use LCN solve distributed transaction error tx - the manager is not connected

Time:09-26

According to the net friend of this article, I use springCloud built a demo
https://segmentfault.com/a/1190000016718525? Utm_source=tag - newest

Before integration LCN, used in a local transaction feign calls to other services, distributed transaction void
After consolidation LCN, Eureka registry, tx_manager and transaction sponsors, participants can normal boot, but in the run test class to test the distributed transaction, the following error,


Java. Lang. Reflect. UndeclaredThrowableException
At com. Tx. Pay. Service. Impl. PayServiceImpl $$EnhancerBySpringCGLIB $$84 edcd5c updatePaymentInfo (& lt; Generated>)
At com. Tx. Pay. Service. PayServiceTest. UpdatePaymentInfo (28) PayServiceTest. Java:
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (498) Method. The Java:
The at org. Junit. Runners. Model. FrameworkMethod $1. RunReflectiveCall (FrameworkMethod. Java: 50)
The at org. Junit. Internal. Runners. Model. ReflectiveCallable. Run (ReflectiveCallable. Java: 12)
The at org. Junit. Runners. Model. FrameworkMethod. InvokeExplosively (FrameworkMethod. Java: 47)
The at org. Junit. Internal. Runners. Statements. InvokeMethod. Evaluate (InvokeMethod. Java: 17)
The at org. Springframework. Test. The context. Takeup. Statements. RunBeforeTestMethodCallbacks. Evaluate (RunBeforeTestMethodCallbacks. Java: 75)
The at org. Springframework. Test. The context. Takeup. Statements. RunAfterTestMethodCallbacks. Evaluate (RunAfterTestMethodCallbacks. Java: 86)
The at org. Springframework. Test. The context. Takeup. Statements. SpringRepeat. Evaluate (SpringRepeat. Java: 84)
The at org. Junit. Runners. ParentRunner. RunLeaf (ParentRunner. Java: 325)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner. RunChild (SpringJUnit4ClassRunner. Java: 252)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner. RunChild (SpringJUnit4ClassRunner. Java: 94)
The at org. Junit. Runners. ParentRunner $3. The run (ParentRunner. Java: 290)
The at org. Junit. Runners. ParentRunner $1. The schedule (ParentRunner. Java: 71)
The at org. Junit. Runners. ParentRunner. RunChildren (ParentRunner. Java: 288)
The at org. Junit. Runners. ParentRunner. Access the $000 (ParentRunner. Java: 58)
At org. Junit. Runners. ParentRunner $2. The evaluate (ParentRunner. Java: 268)
The at org. Springframework. Test. The context. Takeup. Statements. RunBeforeTestClassCallbacks. Evaluate (RunBeforeTestClassCallbacks. Java: 61)
The at org. Springframework. Test. The context. Takeup. Statements. RunAfterTestClassCallbacks. Evaluate (RunAfterTestClassCallbacks. Java: 70)
The at org. Junit. Runners. ParentRunner. Run (ParentRunner. Java: 363)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner. Run (SpringJUnit4ClassRunner. Java: 191)
The at org. Junit. Runner. JUnitCore. Run (JUnitCore. Java: 137)
At com. Intellij. Takeup. JUnit4IdeaTestRunner. StartRunnerWithArgs (JUnit4IdeaTestRunner. Java: 68)
At com. Intellij. Rt. Execution. Junit. IdeaTestRunner $Repeater. StartRunnerWithArgs (IdeaTestRunner. Java: 47)
At com. Intellij. Rt. Execution. Junit. JUnitStarter. PrepareStreamsAndStart (JUnitStarter. Java: 242)
At com. Intellij. Rt. Execution. Junit. JUnitStarter. Main (70) JUnitStarter. Java:
under Caused by: Java. Lang. Exception: tx - manager not connected, do check the tx - manager server
At com. Codingapi. Tx. Aop. Service. Impl. TransactionServerFactoryServiceImpl. CreateTransactionServer (TransactionServerFactoryServiceImpl. Java: 52)
At com. Codingapi. Tx. Aop. Service. Impl. AspectBeforeServiceImpl. Around 50) (AspectBeforeServiceImpl. Java:
At com. Codingapi. Tx. Springcloud. Interceptor. TxManagerInterceptor. Around 30) (TxManagerInterceptor. Java:
At com. Codingapi. Tx. Springcloud. Interceptor. TransactionAspect. TransactionRunning (30) TransactionAspect. Java:
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (498) Method. The Java:
The at org. Springframework. Aop. Aspectj. AbstractAspectJAdvice. InvokeAdviceMethodWithGivenArgs (AbstractAspectJAdvice. Java: 629)
The at org. Springframework. Aop. Aspectj. AbstractAspectJAdvice. InvokeAdviceMethod (AbstractAspectJAdvice. Java: 618)
The at org. Springframework. Aop. Aspectj. AspectJAroundAdvice. Invoke (AspectJAroundAdvice. Java: 70)
The at org. Springframework. Aop. Framework. ReflectiveMethodInvocation. Proceed (ReflectiveMethodInvocation. Java: 168)
The at org. Springframework. Aop. Framework. CglibAopProxy $DynamicAdvisedInterceptor. Intercept (CglibAopProxy. Java: 673)
. 30 more



Method with the code, is TransactionServerFactoryServiceImpl createTransactionServer at fault, as if said netty service status is not normal, I am not sure what is caused by the problem, please correct me used LCN higher-ups, thank you
Public TransactionServer createTransactionServer (TxTransactionInfo info) throws Throwable {
If (info. GetTransaction ()!=null & amp; & Info. GetTransaction (.) isStart () & amp; & Info. GetTxTransactionLocal ()==null & amp; & nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related