技术群: 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. GitHub 热点速览 Vol.27:程序员的自我救赎——GitHub 摸鱼

    作者:HelloGitHub-小鱼干 摘要:都知道 VSCode 有各种摸鱼小插件,边听云音乐.边在 IDE 斗地主,再来一个 NBA 直播,怎一个美滋滋了得.作为 VSCode 的同门,GitHub ...

  2. 线下---复习day04---作业

    1 学的不好的同学:用ajax提交一个json格式数据,返回一个json格式数据,console.log打印出来 2 通过ajax上传一个文件并保存起来,前端接收到,弹窗说上传成功 urls.py f ...

  3. 将PDF转化为wrod

    public static void CreateWord(string HtmlPath, string WordSavePath) { string inputName = HtmlPath; / ...

  4. Spring-Validation(数据校验) 你值得拥有

    前言 最近看到很多童鞋在项目中的对请求参数的校验都用的if来判断各参数的属性,如: if(StringUtils.isBlank(username)){ return RR.exception(&qu ...

  5. 查看mysql所有命令

  6. Scala 面向对象(五):面向对象的特征一:封装性

    1 封装介绍 封装(encapsulation)就是把抽象出的数据和对数据的操作封装在一起,数据被保护在内部,程序的其它部分只有通过被授权的操作(成员方法),才能对数据进行操作. 封装的理解和好处 隐 ...

  7. LDAP脚本批量导出用户

    背景:工作原因,搭建了LDAP服务,然后用户数过多,因为懒所以就通过python代码生成ldap脚本进行批量导入用户 1.整理用户名单,格式如下: 注:上述格式影响代码中的excel读取代码 2.py ...

  8. C/C++中的 if(指针变量) 和 if(!指针变量)

    目录 if(指针变量) 代码演示 if(指针变量) 解读代码 if(!指针变量) 解读代码 总结 替代方案.推荐写法!!!!! if(指针变量) 当把一个指针作为条件表达式时,所要判断的条件实际上就是 ...

  9. OSCP Learning Notes - Capstone(3)

    DroopyCTF Walkthrough Preparation: Download the DroopyCTF virtual machine from the following website ...

  10. Ethical Hacking - NETWORK PENETRATION TESTING(24)

    Detecting suspicious activities using Wireshark You can use make the MAC address of the router to st ...