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时则不需要

Parameter 0 of method sqlSessionTemplate in org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration required a single bean, but 2 were found:的更多相关文章

  1. Parameter 0 of method redisTemplate in org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration required a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactor

    Error starting ApplicationContext. To display the conditions report re-run your application with 'de ...

  2. spring boot:使用分布式事务seata(druid 1.1.23 / seata 1.3.0 / mybatis / spring boot 2.3.2)

    一,什么是seata? Seata:Simpe Extensible Autonomous Transcaction Architecture, 是阿里中间件开源的分布式事务解决方案. 前身是阿里的F ...

  3. spring boot:配置shardingsphere(sharding jdbc)使用druid数据源(druid 1.1.23 / sharding-jdbc 4.1.1 / mybatis / spring boot 2.3.3)

    一,为什么要使用druid数据源? 1,druid的优点 Druid是阿里巴巴开发的号称为监控而生的数据库连接池 它的优点包括: 可以监控数据库访问性能 SQL执行日志 SQL防火墙 但spring ...

  4. mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found

    工具及背景: IntelliJ IDEA 2016.1.3 Ultimate.spring boot, maven项目,利用mybatis 注解的方式查询mysql. 业务逻辑关系:controlle ...

  5. spring boot: filter/interceptor/aop在获取request/method参数上的区别(spring boot 2.3.1)

    一,filter/interceptor/aop在获取参数上有什么区别? 1,filter可以修改HttpServletRequest的参数(doFilter方法的功能), interceptor/a ...

  6. 0. 资料官网【从零开始学Spring Boot】

    [视频&交流平台] àSpringBoot视频 http://study.163.com/course/introduction.htm?courseId=1004329008&utm ...

  7. mybatis spring boot深入

    [size=large]头一篇博文说了整合了spring boot和mybatis大家都可以对后台数据进行操作但是如何才能进行高效的操作数据库节省代码,下面来一起谈论哈mybatis的通用mapper ...

  8. mybatis+spring boot+vue

    参考https://www.cnblogs.com/wlovet/p/8317282.html

  9. spring boot整合mybatis+mybatis-plus

    Spring boot对于我来说是一个刚接触的新东西,学习过程中,发现这东西还是很容易上手的,Spring boot没配置时会默认使用Spring data jpa,这东西可以说一个极简洁的工具,可是 ...

随机推荐

  1. 2018-2019-2 20175217 实验四《Android开发基础》实验报告

    一.实验报告封面 课程:Java程序设计 班级:1752班 姓名:吴一凡 学号:20175217 指导教师:娄嘉鹏 实验日期:2019年5月16日 实验时间:--- 实验序号:实验四 实验名称:And ...

  2. Django实现自动发布(2视图-任务接收)

    上一篇服务版本的新增,是通过触发 gitlab 任务来实现的,那么如何得到任务的最终状态呢? 好在 gitlab 为我们提供了webhook,也就是消息钩子,可以发送pipeline消息到我们指定的地 ...

  3. eXosip、osip,以及UAC和UAS的例子

    UAC(User Agent Client) 和 UAS(User Agent Server) SIP协议采用Client/Server模型.每一个请求(Request)触发服务器的一个操作:每个操作 ...

  4. Intellij idea利用Statistic插件统计项目代码行数

    1 . 插件介绍统计项目中各个文件的数量,大小,行数,平均等信息根据扩展名自定义统计详细行数信息 , 包括总行数,代码行数,代码行数占比,注释行数,注释行数占比,空白行数,空白行数占比自定义选择多个文 ...

  5. 关于 ElementUI 通知组件 notification 重叠问题的解决方案

    转载链接:https://blog.csdn.net/csdn_yudong/article/details/101271214 ElementUI 通知组件(notification) 多个时会重叠 ...

  6. Linux find命令忽略目录的查找方法

    在Linux操作系统中,find命令非常强大,在文件与目录的查找方面可谓无所不至其极,如果能结合xargs命令使得,更是强大无比. 以下来看看find命令忽略目录查找的用法吧. 例1,根据文件属性查找 ...

  7. scrapy中的middleware

    反反爬虫相关机制 Some websites implement certain measures to prevent bots from crawling them, with varying d ...

  8. openvswitch2.11.0修改源码后重新编译

    一:推文 https://www.jianshu.com/p/923f49c290f5(可以删除运行当中的DataPath内核) https://github.com/ebiken/doc-netwo ...

  9. PHP7 引入的“??” 和“?:”的区别

    <?php $array = [ 'a' => 1, 'b' => 2, 'c' => [], ]; $a = $array['c'] ?? 0; $b = $array['c ...

  10. laravel5.8ajax请求auth认证返回302的解决方法。

    注册 /app/Http/Controller/Auth/RegisterController.php <?php namespace App\Http\Controllers\Auth; us ...