스프링 부트로 구성된 스프링 배치/스프링 클라우드 태스크 애플리케이션에 대해 XA/분산 트랜잭션을 구성하려고합니다. 다음 두 클래스는 두 개의 트랜잭션 관리자를 일으킬 그러나스프링 클라우드 태스크의 SimpleTaskConfiguration 및 스프링 배치의 SimpleBatchConfiguration으로 인해 XA 트랜잭션의 스프링 부트 자동 구성 방지
compile("org.springframework.boot:spring-boot-starter-jta-atomikos")
구성 할 :
org.springframework.cloud.task.configuration.SimpleTaskConfiguration
org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration
나는 봄 부팅 자동 구성에 의존하는 희망 다음 종속성을 추가 한
메시지 다음을 참조하십시오
2016-07-18 21:46:19.952 INFO 18995 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'transactionManager' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.cloud.task.configuration.SimpleTaskConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in org.springframework.cloud.task.configuration.SimpleTaskConfiguration]
및 다음 때문에 PlatformTransactionManager
transactionManager
가 구성되어있는 이름, 내 atomikos 자동 구성은 포착되지 않습니다
AtomikosJtaConfiguration did not match
- @ConditionalOnClass classes found: org.springframework.transaction.jta.JtaTransactionManager,com.atomikos.icatch.jta.UserTransactionManager (OnClassCondition)
- @ConditionalOnMissingBean (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) found the following [transactionManager] (OnBeanCondition)
누군가가 나를 도와 주시겠습니까 위의 두 클래스에 의해 초래 된 transactionManager
빈의 강제 실행을 방지 하시겠습니까?
당신이 당신의 문제를 재현 실행 가능한 예 (build.gradle 및 응용 프로그램 클래스)을 제공 할 수 있습니까? 왜냐하면 이전 질문과 마찬가지로, 우리가 할 수있는 모든 것은 우리가 추측 한 것과 추측을 던져 결국에는 아무 것도하지 않기 때문입니다. –
이걸 재현하는 샘플 앱을 만들려고합니다. 나를 참아주십시오. – balteo
쿨, 고마워요. –