博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
redis结合springboot 无法注入redisTemplate问题
阅读量:4650 次
发布时间:2019-06-09

本文共 566 字,大约阅读时间需要 1 分钟。

报错:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.data.redis.core.RedisTemplate<java.io.Serializable, java.io.Serializable>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

之前是,

@Autowiredprivate RedisTemplate
redisTemplate;

 

改成

@Resourceprivate RedisTemplate
redisTemplate;

 

解决。

 

转载于:https://www.cnblogs.com/yaoyuan2/p/10008137.html

你可能感兴趣的文章