技术群: 816227112

参考:https://stackoverflow.com/questions/43455869/could-not-autowire-there-is-more-than-one-bean-of-datasource-type

Parameter 0 of method redisTemplate in org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration required a single bean, but 6 were found:
- agencyConnectionFactory: defined by method 'agencyConnectionFactory' in class path resource [com/sinosoft/config/RedisConfig.class]
- cellConnectionFactory: defined by method 'cellConnectionFactory' in class path resource [com/sinosoft/config/RedisConfig.class]
- mipConnectionFactory: defined by method 'mipConnectionFactory' in class path resource [com/sinosoft/config/RedisConfig.class]
- wechatConnectionFactory: defined by method 'wechatConnectionFactory' in class path resource [com/sinosoft/config/RedisConfig.class]
- ybtbConnectionFactory: defined by method 'ybtbConnectionFactory' in class path resource [com/sinosoft/config/RedisConfig.class]
- ybtgConnectionFactory: defined by method 'ybtgConnectionFactory' in class path resource [com/sinosoft/config/RedisConfig.class]

除了这种还有配置数据库多数据源也会出现这种情况。

解决:

报错的某一个配置上加上@Primary

springboot多数据源启动报错:required a single bean, but 6 were found:的更多相关文章

  1. spring cloud gateway网关启动报错:No qualifying bean of type 'org.springframework.web.reactive.DispatcherHandler'

    网关配置好后启动报错如下: org.springframework.context.ApplicationContextException: Unable to start web server; n ...

  2. SpringBoot发布WAR启动报错:Error assembling WAR: webxml attribute is required

    Spring Boot发布war包流程: 1.修改web model的pom.xml <packaging>war</packaging> SpringBoot默认发布的都是j ...

  3. springboot 启动报错Consider defining a bean of type 'com.example.springbootdruid.mapper.UserMapper' in your configurati

    一.问题 springboot项目启动时报错: Field userMapper in com.example.springbootdruid.service.impl.UserServiceImpl ...

  4. Springboot集成ES启动报错

    报错内容 None of the configured nodes are available elasticsearch.yml配置 cluster.name: fans node.name: no ...

  5. SpringBoot整合nacos启动报错:java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata

    报错信息 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nacosCo ...

  6. SpringBoot学习之启动报错【This application has no explicit mapping for /error.....】

    今天做SpringBoot小例子,在请求controller层的时候出现如下问题. Whitelabel Error Page This application has no explicit map ...

  7. springboot放到linux启动报错:The temporary upload location [/tmp/tomcat.8524616412347407692.8111/work/Tomcat/localhost/ROOT/asset] is not valid

    1.背景 笔者的springboot在一个非root用户环境下运行,这种环境下可以保证不被潜在的jar/开源框架漏洞提权. 比如在防火墙上把外网访问来的443端口映射到本地8443的java web端 ...

  8. SpringBoot整合Elasticsearch启动报错处理 nested exception is java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]

    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wit ...

  9. tomcat启动报错:注释指定的bean类.与现有的冲突.相同的名称和类

    错误: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/business/config ...

随机推荐

  1. JSOI2015 Salesman(树型DP)

    [luogu6082] [题目描述] 某售货员小T要到若干城镇去推销商品,由于该地区是交通不便的山区,任意两个城镇之间都只有唯一的可能经过其它城镇的路线. 小T 可以准确地估计出在每个城镇停留的净收益 ...

  2. Linux系统 Centos7 环境基于Docker部署Rocketmq服务

    消息队列 基本概述 MQ,Message Queue,基于TCP协议构建的简单协议,区别于具体的通信协议. 基于通信协议定义和抽象的更高层次的通信模型,一般都是生产者和消费者模型,又或者说服务端和客户 ...

  3. # scrapy(二):get请求

    scrapy中的get请求及基本使用: 1. 创建scrapy项目 scrapy startproject QiuBaiProject 2. 创建爬虫文件 scrapy genspider QiuBa ...

  4. python数据处理(一)之供机器读取的数据 csv,json,xml

    代码与资料 https://github.com/jackiekazil/data-wrangling 1 csv 1.1导入csv数据 1.2将代码保存到文件中并在命令行中运行 2.json 2 导 ...

  5. java 数据结构(十二):Collections工具类的使用

    Collections工具类1.作用:操作Collection和Map的工具类 2.常用方法:reverse(List):反转 List 中元素的顺序shuffle(List):对 List 集合元素 ...

  6. Log4net控制台和窗体程序无法输出记录的原因之一

    在asp.net web应用程序中,读取log4net的配置文件可以这样写: [assembly:log4net.Config.XmlConfigurator(ConfigFile="Web ...

  7. JavaScript图形实例:平面镶嵌图案

    用形状.大小完全相同的一种或几种平面图形进行拼接,彼此之间不留空隙.不重叠地铺成一片,就叫做这几种图形的平面镶嵌. 1.用一种多边形实现的平面镶嵌图案 我们可以采用正三角形.正方形或正六边形实现平面镶 ...

  8. Ant-Design-Vue中关于Table组件的使用

    1. 如何自定义表格列头: <a-table :columns="columns" :dataSource="dataSource"> <sp ...

  9. Cyber Security - Palo Alto Security Policies(1)

    Security policies: Enforcing network traffic by configuring rules of what is allowed or denied to co ...

  10. html-webpack-plugin在html中插入数据

    html-webpack-plugin在html中插入数据 <!DOCTYPE html> <html> <head> <meta charset=" ...