• Parameter 0 of method sqlSessionTemplate in org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration required a single bean, but 2 were found:


    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基本数据类型(—)
    linux基本命令
    1、认识Mysql
    Flask-SQLAlchemy详解
    sqlalchemy基本增删改查
    pymongo方法详解
    uWSGI+Nginx部署
    uwsgi
    nginx负载均衡配置
    redis-sentinel主从复制高可用(哨兵)
  • 原文地址:https://www.cnblogs.com/suizhikuo/p/11057224.html
Copyright © 2020-2023  润新知