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 ...
随机推荐
- Scala数据结构(二)
一.集合的基础操作 1,head头信息 //获取集合的第一个元素 val list = List(,,) list.head // 2,tail尾信息 //获取集合除去头元素之外的所有元素 val l ...
- 「疫期集训day13」雾天
我们千里迢迢赶来这里支援协约国----与德军正面交锋的美国士兵 今天考试签到题都没A,失误重大,T1几周前做过的拓扑排序板子都没写,T2失误在没敢调试,对自己信心不足,30分钟写了个DP,几分钟没调出 ...
- Mysql 常用语句实战(1)
前置 sql 语句 用来创建表.插入数据 DROP TABLE IF EXISTS `emp`; CREATE TABLE `emp` ( `id` int(11) NOT NULL COMMENT ...
- [JAVA]解决不同浏览器下载附件的中文名乱码问题
附件下载时,遇到中文附件名的兼容性问题,firefox.chrome.ie三个派系不兼容,通过分析整理,总结出处理该问题的办法,记录如下: 1.文件名编码 服务器默认使用的是ISO8859-1,而我们 ...
- pip install scrapy报错:error: Unable to find vcvarsall.bat解决方法
今天在使用pip install scrapy 命令安装Scrapy爬虫框架时,出现了很让人头疼的错误,错误截图如下: 在网上查找解决方法时,大致知道了问题的原因.是因为缺少C语言的编译环境,其中一种 ...
- Python之爬虫(二十六) Scrapy登录知乎
因为现在很多网站为了限制爬虫,设置了为只有登录才能看更多的内容,不登录只能看到部分内容,这也是一种反爬虫的手段,所以这个文章通过模拟登录知乎来作为例子,演示如何通过scrapy登录知乎 在通过scra ...
- How to change the text color in the terminal
You can open the file ~/.bashrc and then choose the force_color_prompt=yes otherwise, you can change ...
- 你应该知道的ip地址相关知识
IP地址是一个网卡在网络世界里的通讯地址,相当于我们家里的门牌号码.这样类比的话,很显然ip地址是唯一的.在windows系统中,我们可以使用 ipconfig 命令查看本机的ip地址相关信息: 图中 ...
- 老司机带你玩转面试(2):Redis 过期策略以及缓存雪崩、击穿、穿透
前文回顾 建议前一篇文章没看过的同学先看下前面的文章: 「老司机带你玩转面试(1):缓存中间件 Redis 基础知识以及数据持久化」 过期策略 Redis 的过期策略都有哪些? 在聊这个问题之前,一定 ...
- Postman接口测试实战分享,这5个问题你必须得知道!【软件测试工程师经验分享】
在我们日常的测试工作中,接口测试其实很普遍,无论你是做什么测试,功能.自动化亦或是性能测试,都会或多或少接触到接口. 最近也有许多人来询问我:接口测试怎么测?接口测试工具有哪些? 下面我来帮你一一剖析 ...