No qualifying bean of type 'org.springframework.transaction.TransactionManager' available
时间: 2023-11-14 09:03:19 浏览: 361
这个错误的原因是在项目中配置了多个数据源,但在使用@Transactional()注解时没有直接指定使用的事务管理器,导致Spring无法确定具体使用哪一个事务管理器来进行事务管理。解决这个问题的方法是通过在@Transactional注解中指定使用的事务管理器,可以使用@Transactional(transactionManager = "xxTransactionManager")来进行指定。另外,还需要确保配置的事务管理器对象上添加了@Bean注解,以便Spring能够扫描到它们。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* [解决No qualifying bean of type ‘org.springframework.transaction.PlatformTransactionManager](https://blog.csdn.net/web13985085406/article/details/126607568)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [No qualifying bean of type ‘org.springframework.transaction.Platform](https://blog.csdn.net/qq_39486119/article/details/118213039)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [springboot事务回滚报错No qualifying bean of type ‘org.springframework.transaction....](https://blog.csdn.net/qq_41419769/article/details/120306506)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文