Parameter 0 of method sqlSessionTemplate in org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration required a single bean, but 2 were found:
2024-08-31 07:21:05
Parameter 0 of method orderSqlSessionFactory in com.config.MultipleDBConfig required a single bean, but 2 were found:
- orderDataSource: defined by method 'orderDataSource' in class path resource [com/config/MultipleDBConfig.class]
- crmDataSource: defined by method 'crmDataSource' in class path resource [com/config/MultipleDBConfig.class]
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
坑:以上方式链接多数据源时,
在springboot1.x时 datasource上要在一个写数据源上标记@Primary为主数据源
而在springboot2.X时则不需要
最新文章
- Python体验(07)-图形界面之菜单
- PPTP(Point to Point Tunneling Protocol),即点对点隧道协议。
- Oracle中有个tkprof来格式化oracle的trace文件
- Selenium2+python自动化21-TXT数据参数化
- .NET String.Format 方法 线程安全问题
- 用Windows API函数(CreateFile/ReadFile/WriteFile/CloseHandle)完成文件拷贝程序(初级版)
- 使用ndk standalone工具链来编译某个平台下的库
- 权重随机算法的java实现
- FreeCodeCamp:Return Largest Numbers in Arrays
- Metadata是.NET平台的核心灵魂--(转载)
- [UI列表]LoopScrollRect无限滑动不卡顿
- vim 高级应用
- Spring再接触 Scope范围
- Confluence 6 查看你的许可证细节
- nginx+tomcat抵御慢速连接攻击
- Perl操作Oracle
- 量身打造自己的MyEclipse(多图)
- 【树】Unique Binary Search Trees
- PHP7 学习笔记(二)PHP5.9 升级到PHP7 遇到的一些坑的记录(php-fpm 图解)
- 图像BMP格式介绍