Spring boot使用Redis时,报错,有redisTemplate和stringRedisTemplate两个bean?
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-05-13 20:11:30.651 ERROR 1869 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method setRedis in cn.andhub.authorization.manager.impl.RedisTokenManager required a single bean, but 2 were found:
- redisTemplate: defined by method 'redisTemplate' in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration$RedisConfiguration.class]
- stringRedisTemplate: defined by method 'stringRedisTemplate' in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration$RedisConfiguration.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
解决办法:
spring-boot-starter-parent最新版本应该是2.0.0,就会报这个错,更改如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version> //降低parent版本
<relativePath/> <!-- lookup parent from repository -->
</parent>
Spring boot使用Redis时,报错,有redisTemplate和stringRedisTemplate两个bean?的更多相关文章
- spring boot启动STS 运行报错 java.lang.NoClassDefFoundError: ch/qos/logback/classic/LoggerContext
spring boot启动STS 运行报错 java.lang.NoClassDefFoundError: ch/qos/logback/classic/LoggerContext 学习了: http ...
- Spring Boot JPA分页 PageRequest报错
在使用Spring Boot JPA分页 PageRequest分页时,出现如下错误: 本来以为是包导入出现了问题,结果发现并不是.导入包如下: 后来在网上查找相关资料,发现这样的用法,好像也可以用, ...
- spring boot jpa 使用update 报错解决办法
在spring boot jpa 中自定义sql,执行update操作报错解决办法: 在@Query(...)上添加 @Modifying@Transactional注解
- 【spring cloud】【spring boot】项目启动报错:Cannot determine embedded database driver class for database type NONE
解决参考文章:https://blog.csdn.net/hengyunabc/article/details/78762097 spring boot启动报错如下: Error starting A ...
- 【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration. 【Mapper类不能被找到】@Mapper 和@MapperScan注解的区别
启动报错: 2018-05-16 17:22:58.161 ERROR 4080 --- Disconnected from the target VM, address: '127.0.0.1:50 ...
- spring boot jar包替换报错之Unable to open nested entry 'BOOT-INF/lib/cache-api-0.4.jar'.
spring boot用layout ZIP打出来的包能够支持外部classpath,但是当用rar/7zip替换其中的jar后,报下列错误: Unable to open nested entry ...
- spring boot未配置数据源报错
我拷贝了一个springboot 项目,然后去掉了数据源配置启动报错 : Cannot determine embedded database driver class for database ty ...
- Spring Boot项目Maven Build报错的解决方法
问题1, [ERROR]Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (defau ...
- spring boot 使用thymeleaf模版 报错:org.thymeleaf.exceptions.TemplateInputException
错误: org.thymeleaf.exceptions.TemplateInputException: Error resolving template "Hello", tem ...
随机推荐
- 安装IE11必备更新
https://support.microsoft.com/zh-cn/help/2847882
- cef加载flash的办法
cef有2种加载flash插件的方式, 1,npapi,这种方式是调用系统自带的flash插件,由于有安全性方面的问题,已经被新版cef禁用. 2,ppapi,也就是 pepper flash,这是谷 ...
- vuejs与angularjs以及react的区别?
1.与AngularJS的区别 相同点: 都支持指令:内置指令和自定义指令. 都支持过滤器:内置过滤器和自定义过滤器. 都支持双向数据绑定. 都不支持低端浏览器. 不同点: 1.AngularJS的学 ...
- @Conditional注解
根据条件动态创建bean public class TestConditon implements Condition { public boolean matches(ConditionContex ...
- 【机器学习】Jackknife,Bootstraping, bagging, boosting, AdaBoosting, Rand forest 和 gradient boosting
Jackknife,Bootstraping, bagging, boosting, AdaBoosting, Rand forest 和 gradient boosting 这些术语,我经常搞混淆, ...
- 代码: 0x80131500 win10应用商店崩溃了
网上搜索大部分认同的结果如下 1.打开“运行”输入 inetcpl.cpl (“WINDOWS”+“R”键,输入 inetcpl.cpl亦可) 2.点开高级往下拉,勾上"使用TLS 1.2& ...
- CentOS7修改内核启动顺序
CentOS7修改内核启动顺序: 1.首先查看当前系统有几个内核 cat /boot/grub2/grub.cfg |grep menuentry 2.查看当前默认内核 grub2-editenv ...
- C++深拷贝和浅拷贝细节理解
前提 在对象拷贝过程中,如果没有自定义拷贝构造函数,编译器会提供一个缺省的拷贝构造函数,缺省的拷贝构造函数对于基本类型的成员变量,按字节复制,对于类类型的成员变量则调用其相应的拷贝构造函数. 资料注解 ...
- C++常见面试题:
一.进程和线程的概念和区别 1.进程是系统进行资源调度的基本单位 2.线程是系统进行运算调度(处理器分配{CPU.内存})的基本单位 二.进程间的通信 进程间的通信共有5种: 1.管道 通常指无名管道 ...
- 为什么要学习Hive
一 为什么要学习HIVE? 为什么不是ORACLE和MYSQL? 因为大数据时代 数据量成几何倍数增长,并且数据量非常庞大.大到要用PB EB这种量级去衡量.而我们的ORACLE/MYQL这种 ...