首页 > 编程语言 > 详细

Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.

时间:2019-07-06 22:47:15      阅读:3132      评论:0      收藏:0      [点我收藏+]
***************************
APPLICATION FAILED TO START
***************************

Description:

Field redisTemplate in com.demo.service.UserServiceImpl required a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ that could not be found.
- Bean method ‘stringRedisTemplate‘ in ‘RedisAutoConfiguration‘ not loaded because @ConditionalOnMissingBean (types: org.springframework.data.redis.core.StringRedisTemplate; SearchStrategy: all) found beans of type ‘org.springframework.data.redis.core.StringRedisTemplate‘ template


Action:

Consider revisiting the entries above or defining a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ in your configuration.

技术分享图片

点击查看大图

通过上面的Description信息可以看出来,报错在UserServiceImpl 中,具体UserServiceImpl 代码如下图所示:

技术分享图片

解决方案:

RedisTemplate<String, List> redisTemplate 的注解 @Autowired 更换为 @Resource

再次运行,问题搞定。

你可能感兴趣的文章:

Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.

原文:https://www.cnblogs.com/toutou/p/could_not_be_found.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!