700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Redis报错Field redisTemplate in xxx required a bean of type ‘org.x.RedisTemplate‘that can not be foud

Redis报错Field redisTemplate in xxx required a bean of type ‘org.x.RedisTemplate‘that can not be foud

时间:2022-05-18 14:08:27

相关推荐

Redis报错Field redisTemplate in xxx required a bean of type ‘org.x.RedisTemplate‘that can not be foud

一、问题描述

在注入RedisTemplate报错

二、解决办法

2.1使用@Resource注入

@Resourceprivate RedisTemplate<String, Object> redisTemplate;

2.2使用@Autowired

@Autowiredprivate RedisTemplate redisTemplate;

至于为什么这样做,可以参考如下链接:

/weixin_40910372/article/details/103832586

/gududedabai/article/details/100660916

更多资料,欢迎关注

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。