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
发布评论