springboot 配置RedisTemplate 报:Field redisTemplate in XXX required a bean of type ‘org.springframework

编程入门 行业动态 更新时间:2024-10-22 03:57:56

springboot 配置<a href=https://www.elefans.com/category/jswz/34/1730168.html style=redisTemplate 报:Field redisTemplate in XXX required a bean of type ‘org.springframework"/>

springboot 配置RedisTemplate 报:Field redisTemplate in XXX required a bean of type ‘org.springframework

错误信息如下:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-09-09 14:16:09.385 ERROR 10464 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : ***************************
APPLICATION FAILED TO START
***************************Description:Field redisTemplate in com.jr.service.planokr.utils.RedisUtil 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.Disconnected from the target VM, address: '127.0.0.1:51021', transport: 'socket'Process finished with exit code 1


如果你的jar引入,并且版本对的话,

检查你的用法:

  @Autowiredprivate RedisTemplate<String, Object> redisTemplate;

改为:

  @Autowiredprivate RedisTemplate  redisTemplate;

更多推荐

springboot 配置RedisTemplate 报:Field redisTemplate in XXX required a bean of type

本文发布于:2024-02-10 19:00:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1676819.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:redisTemplate   XXX   Field   springboot   RedisTemplate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!