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?的更多相关文章

  1. spring boot启动STS 运行报错 java.lang.NoClassDefFoundError: ch/qos/logback/classic/LoggerContext

    spring boot启动STS 运行报错 java.lang.NoClassDefFoundError: ch/qos/logback/classic/LoggerContext 学习了: http ...

  2. Spring Boot JPA分页 PageRequest报错

    在使用Spring Boot JPA分页 PageRequest分页时,出现如下错误: 本来以为是包导入出现了问题,结果发现并不是.导入包如下: 后来在网上查找相关资料,发现这样的用法,好像也可以用, ...

  3. spring boot jpa 使用update 报错解决办法

    在spring boot jpa 中自定义sql,执行update操作报错解决办法: 在@Query(...)上添加 @Modifying@Transactional注解

  4. 【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 ...

  5. 【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 ...

  6. 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 ...

  7. spring boot未配置数据源报错

    我拷贝了一个springboot 项目,然后去掉了数据源配置启动报错 : Cannot determine embedded database driver class for database ty ...

  8. Spring Boot项目Maven Build报错的解决方法

    问题1, [ERROR]Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (defau ...

  9. spring boot 使用thymeleaf模版 报错:org.thymeleaf.exceptions.TemplateInputException

    错误: org.thymeleaf.exceptions.TemplateInputException: Error resolving template "Hello", tem ...

随机推荐

  1. markdown基础使用

    标题 # 这是一级标题 ## 这是二级标题 ### 这是三级标题 #### 这是四级标题 ##### 这是五级标题 ###### 这是六级标题 实际效果       字体 **加粗字体** *斜体* ...

  2. ubuntu安装软件失败,出现404错误,更新软件源

    更新源方法 备份原来的源 首先备份原来的源,用来出错后进行恢复 sudo cp /etc/apt/sources.list/etc/apt/sources.list_backup 1 如果更新源后出错 ...

  3. ubuntu下自动获取ip设置

    vi /etc/network/interfaces文件为如下内容 wq保存 重启网卡:sudo /etc/init.d/networking restart

  4. Laravel验证问题记录

    1.当购物车提交时,POST传来一个对象{address:2,item:{ {ksu_id:2,count:2},{ksu_id:2,count:2}, } 验证方法: public function ...

  5. C++ unsigned long 转化为 unsigned char*

    C++ Code 123456789101112131415161718   unsigned long lFileLen = 1000; unsigned char *ucFileLenFlag; ...

  6. aws 基于延迟策略配置dns故障切换

    前提:由于国内访问首尔地区经常出现不稳定情况,现将请求从nginx(sz)转发到nginx(hk)再转发到首尔地区,在基于不改变nginx(seoul)的配置的前提下,引入aws的延迟策略,同时保证国 ...

  7. 云数据库 Redis 版

    首先观看视频简介 云数据库 Redis 版是一项易于部署和管理的按需数据库服务,与 Redis 协议兼容.云数据库 Redis 版通过从内存缓存中检索数据而提供高速数据读写功能,并通过同时使用内存和硬 ...

  8. TestNG并发兼容性测试

    Web测试项目中经常进行浏览器兼容性相关的测试工作,因为兼容性测试的工作重复性相当高,所以导致手工测试效率低下测试人员积极性降低.TestNG提供了并发执行测试用例的功能,可以让测试用例以并发的形式执 ...

  9. Head First PHP&MySQl第一章代码

    HTML: <!doctype html> <html lang="zh-cn"> <head> <meta charset=" ...

  10. 一些通用的js工具类,添加自定义插件

    common_t.js /** * 通用工具组件 对原有的工具进行封装,自定义某方法统一处理<br> * ^_^ * * Author: em.D * Date: 2016-05-17 * ...