springboot使用redisTemplate 报错:

template in com.j.ssm.tool.RedisUtil required a single bean, but 2 were found:
- redisTemplate: defined by method ‘redisTemplate’ in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.class]
- stringRedisTemplate: defined by method ‘stringRedisTemplate’ in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.class]
原因:
在工具类中
template与redis默认处理装载redis的对象{RedisAutoConfiguration.class}中定义的方法重名

如图:

只需要将自动装配的对象的名称,改为RedisAutoConfiguration不相冲突的名字即可

springboot使用redisTemplate 报错:APP FAILED TO START Field template in required a single bean redis工具类相关推荐

  1. 代码Service方法都报 Parameter 0 of constructor in com.fan.xx required a single bean, but 2 were found原因分析

    今天遇到一个问题,拉取同事的代码,发现编译不过,报错如下: *************************** APPLICATION FAILED TO START ************** ...

  2. springBoot使用RestTemplate报错:No instance available for xxx.xxx.xxx.xxx

    springBoot使用RestTemplate报错:No instance available for xxx.xxx.xxx.xxx 解决方案:添加配置类 解决方案:添加配置类 @Configur ...

  3. 社区版IDEA创建SpringBoot项目及报错Error: Request failed with status code 404解决

    社区版IDEA创建SpringBoot项目 IDEA创建由于社区版没有创建SpringBoot的工具,我们一般使用插件进行创建 搜索插件spring assistant 进行下载 下载后我们进行项目创 ...

  4. 在react-nactive项目中运行时,报错error Failed to install the app

    在react-nactive项目中运行时,报错 error Failed to install the app. Make sure you have the Android development ...

  5. SpringBoot项目启动报错:Field userMapper in com.demo.controller.MemberController required a bean of type ‘c

    问题描述: SpringBoot项目启动报错,报错内容:'com.xxx.mapper.XxxxMapper' that could not be found ******************** ...

  6. 报错:FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask原因查找

    项目场景: 使用hive分析.处理数据时 问题描述 执行hive语句后,报错:FAILED: Execution Error, return code 2 from org.apache.hadoop ...

  7. ReactNative打Release生产包报错error: failed parsing overlays

    ReactNative打Release生产包报错error: failed parsing overlays 一,生成静态JS Bundle文件 在项目根目录下执行以下命令: react-native ...

  8. android studio 编译遇到报错 app:compileDebugJavaWithJavac 处理办法

    android studio编译遇到报错app:compileDebugJavaWithJavac处理办法 android studio 在编译时经常会遇到如下图片中这个错误,但是程序运行时可以正常运 ...

  9. springboot启动报错Parameter 0 of method a in com.* required a bean of type 'java.lang.String' that could

    springboot服务启动报错,报错信息如下 *************************** APPLICATION FAILED TO START ******************** ...

最新文章

  1. 轻松实现QQ用户接入
  2. 大年初一,今年的春晚你看了吗?
  3. python 面向对象实现CNN(四)
  4. DHCP 服务原理:Snooping和Relay
  5. 面试官问我圆角边框,我交出了满分的答卷!——Web前端系列学习笔记
  6. 浅谈servlet与jsp的关系
  7. 主干网络系列(2) -ResNet V2:深度残差网络中的恒等映射
  8. jtree和mysql_让JTree所有节点展开和关闭的类 - 我爱看火影的日志 - 网易博客
  9. DT大数据梦工厂视频资源
  10. 【DNN】——多尺度注意力
  11. 【技巧】谷歌Chrome浏览器清理缓存的两种方式
  12. MSCS+FailSafe 双机集群做HA 小结
  13. Window系统多硬盘设置新引导盘
  14. 手机屏幕按键测试软件,涨见识了——手机居然能作为维修检测工具来用!
  15. 前端搜索引擎优化SEO优化之Title 和 Meta 标签
  16. Hbase+Solr操作手册
  17. 如何用好 Google 搜索引擎?
  18. Mixly for Arduino(图形化编程工具) Mac安装
  19. okhttp下载保存图片并更新图库
  20. 终极五笔 v6.02 正式版 下载

热门文章

  1. jquery ajax POST/GET 请求至 ASP.NET WebAPI
  2. JDBC 创建连接对象的三种方式 、 properties文件的建立、编辑和信息获取
  3. DWR推送的一些随笔
  4. javase学习第10天(形式参数和返回值类型、包、内部类、匿名内部类)
  5. java(eclipse)和数据库(mysql)的连接
  6. C实战:项目构建Make,Automake,CMake
  7. 设计模式之: 装饰器模式
  8. ubuntu安装oracle数据库乱码问题解决方案(超级简单)
  9. Struts2运行机制(MVC)的分析:
  10. Xcode 卸载方法