当前位置:   article > 正文

springboot 配置RedisTemplate 报:Field redisTemplate in XXX required a bean of type ‘org.springframework_field redistemplate in jnpf.util.redisutil require

field redistemplate in jnpf.util.redisutil required a bean of type 'org.spri

错误信息如下:

  1. Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  2. 2019-09-09 14:16:09.385 ERROR 10464 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
  3. ***************************
  4. APPLICATION FAILED TO START
  5. ***************************
  6. Description:
  7. 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.
  8. The injection point has the following annotations:
  9. - @org.springframework.beans.factory.annotation.Autowired(required=true)
  10. Action:
  11. Consider defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration.
  12. Disconnected from the target VM, address: '127.0.0.1:51021', transport: 'socket'
  13. Process finished with exit code 1


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

检查你的用法:

  1. @Autowired
  2. private RedisTemplate<String, Object> redisTemplate;

改为:

  1. @Autowired
  2. private RedisTemplate redisTemplate;

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/125746
推荐阅读
相关标签
  

闽ICP备14008679号