springboot多数据源启动报错:required a single bean, but 6 were found:
技术群: 816227112
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:的更多相关文章
- spring cloud gateway网关启动报错:No qualifying bean of type 'org.springframework.web.reactive.DispatcherHandler'
网关配置好后启动报错如下: org.springframework.context.ApplicationContextException: Unable to start web server; n ...
- SpringBoot发布WAR启动报错:Error assembling WAR: webxml attribute is required
Spring Boot发布war包流程: 1.修改web model的pom.xml <packaging>war</packaging> SpringBoot默认发布的都是j ...
- 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 ...
- Springboot集成ES启动报错
报错内容 None of the configured nodes are available elasticsearch.yml配置 cluster.name: fans node.name: no ...
- SpringBoot整合nacos启动报错:java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
报错信息 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nacosCo ...
- SpringBoot学习之启动报错【This application has no explicit mapping for /error.....】
今天做SpringBoot小例子,在请求controller层的时候出现如下问题. Whitelabel Error Page This application has no explicit map ...
- 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端 ...
- 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 ...
- tomcat启动报错:注释指定的bean类.与现有的冲突.相同的名称和类
错误: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/business/config ...
随机推荐
- zabbix + grafana 展示
环境CentOS 7.5 一,grafana 安装. 1,配置yum源 cat > /etc/yum.repos.d/grafana.repo <<EOF [grafana] nam ...
- pycharm设置字体和背景色
Pycharm字体和背景色设置 1 菜单字体大小设置 设置后: 2.编辑字体大小设置 3.背景色设置
- 深克隆(deepclone)
1.简单版: <script type="text/javascript"> const newObj = JSON.parse(JSON.stringify(oldO ...
- 数据可视化之DAX篇(十五)Power BI按表筛选的思路
https://zhuanlan.zhihu.com/p/121773967 数据分析就是筛选.分组.聚合的过程,关于筛选,可以按一个维度来筛选,也可以按多个维度筛选,还有种常见的方式是,利用几个特 ...
- 爬虫07 /scrapy图片爬取、中间件、selenium在scrapy中的应用、CrawlSpider、分布式、增量式
爬虫07 /scrapy图片爬取.中间件.selenium在scrapy中的应用.CrawlSpider.分布式.增量式 目录 爬虫07 /scrapy图片爬取.中间件.selenium在scrapy ...
- Django之模型的_meta属性
Python有反射机制,Django也不例外,也有很好的反射机制,每个Django模型都有一个属性_meta,_meta也有属性和方法,这些属性和方法反射出了模型的一些特性,如果_meta用的好的话, ...
- 前端05 /js基础
前端05 /js基础 昨日内容回顾 css选择器的优先级 行内(1000) > id(100) > 类(10) > 标签(1) > 继承(0) 颜色 rgb(255,255,2 ...
- 手把手整合SSM框架
前言 如果看过前几篇文章,对 Spring 和 MyBatis 有了一定了解,一定想上手试试.这篇文章从 0 到 1,手把手整合 SSM (Spring.Spring MVC.MyBatis). 本篇 ...
- MVC + EFCore 项目实战 - 数仓管理系统5 – 菜单配置及里程碑划分
上次课程我们完成了需求的梳理. 我们根据梳理的需求把菜单配好,另外我们把项目里程碑也配置在系统中,开发和管理都在系统中,形成无文档化管理. 一.菜单配置 根据我们的归纳图,我们先将菜单配置好. 我们遵 ...
- Java8之Stream 集合聚合操作集锦(含日常练习Demo)
Stream 是用函数式编程方式在集合类上进行复杂操作的工具,其集成了Java 8中的众多新特性之一的聚合操作,开发者可以更容易地使用Lambda表达式,并且更方便地实现对集合的查找.遍历.过滤以及常 ...