Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.
2024-10-06 13:12:56
***************************
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
再次运行,问题搞定。
你可能感兴趣的文章:
- Difference in @Resource and @Autowired
- Spring 注释 @Autowired 和@Resource 的区别
- @Resource与@Autowired用法区别
- 简析@Resource 和 @Autowired的区别
最新文章
- The connection to adb is down, and a severe error has occured.(转)
- QT toLocal8Bit奇怪的问题
- C#开发Activex控件(2)
- ruby字符串学习笔记4
- 服务器部署_nginx报错: [warn] conflicting server name ";www.test.com"; on 0.0.0.0:80, ignored
- jbpm4.4 demo2
- AFNetworiking与ASIHttpRequest对比
- tabbar加小红点
- jQuery第十一章
- pip 警告!The default format will switch to columns in the future
- 【转】千万不要在JS中使用连等赋值操作
- 伸展树Splay【非指针版】
- Git上传文件容量大小限制
- 通过shell操作串口
- 奶牛编号(Cowids) [NOIP模拟]
- 【C++】获取URL中主机域名
- etymon word air aero aeri aer ag agreement walk joint trick skill chief forget out~1
- Dictionary应用
- bzoj 2111 [ZJOI2010]Perm 排列计数(DP+lucas定理)
- Renesas 符号地址空间对齐