required a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ that could not be found.

本文涉及的产品
云原生内存数据库 Tair,内存型 2GB
云数据库 Redis 版,标准版 2GB
推荐场景:
搭建游戏排行榜
简介: required a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ that could not be found.

1、报错信息如下:

***************************
APPLICATION FAILED TO START
***************************
Description:
Field redisTemplate in com.xialj.demoend.service.impl.UploadServiceImpl required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.
The injection point has the following annotations:
  - @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration.

2、解决方案:

将 :

@Autowired
private RedisTemplate<String, Object> redisTemplate;

改为:

   @Resource
   private RedisTemplate<String, Object> redisTemplate;
相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore &nbsp; &nbsp; ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库&nbsp;ECS 实例和一台目标数据库&nbsp;RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&amp;RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
3月前
|
消息中间件 NoSQL Redis
Redis第三弹,定时删除1.优先级队列(堆)2.基于时间轮实现的定时器​编辑Type指令(返回key对应的数据类型)redis的数据类型hset key field value
Redis第三弹,定时删除1.优先级队列(堆)2.基于时间轮实现的定时器​编辑Type指令(返回key对应的数据类型)redis的数据类型hset key field value
|
12月前
|
存储 NoSQL Java
Redis类型(Type)与编码(Encoding)
Redis是一款开源的高性能key-value数据库,广泛应用于各种场景。在Redis中, 数据类型(Type)和编码(Encoding) 是非常重要的概念。本篇博客将详细介绍Redis支持的数据类型以及相应的编码方式和底层实现原理。
67 0
|
缓存 NoSQL Redis
Bean named ‘redisTemplate‘ is expected to be of type ‘org.springframework.data.redis.core.StringRedi
Bean named ‘redisTemplate‘ is expected to be of type ‘org.springframework.data.redis.core.StringRedi
Bean named ‘redisTemplate‘ is expected to be of type ‘org.springframework.data.redis.core.StringRedi
|
NoSQL Redis
Redis序列化的问题:Failed to deserialize object type
您好,我是码农飞哥,感谢您阅读本文!最近在进行框架改造,历史遗留代码对Redis的使用不当,导致了一些问题。
421 0
Redis序列化的问题:Failed to deserialize object type
|
Linux PHP NoSQL
***报错Class &#39;Redis&#39; not found in(原创)
报错:Class 'Redis' not found in 这个报错,表明phpredis 扩展没有安装好,而不是redis没有安装   有没有安装成功这个扩展,可以通过phpinfo来查看。   解决问题的方法: 安装phpredis扩展   我自己安装的是宝塔Linux   首先下载phpredis,下载地址:https://github.
2253 0
|
6天前
|
canal 缓存 NoSQL
Redis缓存与数据库如何保证一致性?同步删除+延时双删+异步监听+多重保障方案
根据对一致性的要求程度,提出多种解决方案:同步删除、同步删除+可靠消息、延时双删、异步监听+可靠消息、多重保障方案
Redis缓存与数据库如何保证一致性?同步删除+延时双删+异步监听+多重保障方案
|
26天前
|
缓存 NoSQL Redis
【Azure Redis 缓存】Redission客户端连接Azure:客户端出现 Unable to send PING command over channel
【Azure Redis 缓存】Redission客户端连接Azure:客户端出现 Unable to send PING command over channel
|
22天前
|
缓存 NoSQL Java
Redis深度解析:解锁高性能缓存的终极武器,让你的应用飞起来
【8月更文挑战第29天】本文从基本概念入手,通过实战示例、原理解析和高级使用技巧,全面讲解Redis这一高性能键值对数据库。Redis基于内存存储,支持多种数据结构,如字符串、列表和哈希表等,常用于数据库、缓存及消息队列。文中详细介绍了如何在Spring Boot项目中集成Redis,并展示了其工作原理、缓存实现方法及高级特性,如事务、发布/订阅、Lua脚本和集群等,帮助读者从入门到精通Redis,大幅提升应用性能与可扩展性。
48 0
|
26天前
|
缓存 NoSQL Redis
【Azure Redis 缓存】使用StackExchange.Redis,偶发ERROR - Timeout performing HSET (15000ms)
【Azure Redis 缓存】使用StackExchange.Redis,偶发ERROR - Timeout performing HSET (15000ms)
|
26天前
|
缓存 NoSQL Java
【Azure Redis 缓存】示例使用 redisson-spring-boot-starter 连接/使用 Azure Redis 服务
【Azure Redis 缓存】示例使用 redisson-spring-boot-starter 连接/使用 Azure Redis 服务