我有一个春天启动的应用程序作为一个Spring JMS监听器。我为Oracle配置了多个数据源管理器,另一个配置了DB2。禁用事务管理可以在Spring的JMS的监听
无论何时我开始应用程序,jms listener容器正在寻找一个事务管理器bean并在发现两个bean时给出下面的错误。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jms.JmsAnnotationDrivenConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.transaction.PlatformTransactionManager org.springframework.boot.autoconfigure.jms.JmsAnnotationDrivenConfiguration.transactionManager; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.transaction.PlatformTransactionManager] is defined: expected single matching bean but found 2: db2TransactionManager,oracleTransactionManager
我不想维护JMS事务。我怎么能实现它,或者我们如何禁用jms事务功能?下面
是我对我的主弹簧引导类添加注释。还我使用春数据仓库
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class})
@ComponentScan(basePackages = "com.deere.oracledataupdate.*")
//@EnableJpaRepositories(basePackages ="com.deere.oracledataupdate.dao.springdata")
@EntityScan(basePackages = "com.deere.oracledataupdate.*")
@PropertySource({ "classpath:application-${IafConfigSuffix}.properties" })
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
您使用哪种弹簧启动版本。 –
我正在使用1.2.3.RELEASE的春季启动 –
更新到最新的1.2.6 ...早期版本的JMS自动配置依赖于PlatformTransactionManager新版本特定的JtaTransactionManager(通常)意识到在那里进行交易。 –