redis结合springboot 无法注入redisTemplate问题
报错:
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)}
之前是,
@Autowired private RedisTemplate<String, Object> redisTemplate;
改成
@Resource private RedisTemplate<String, Object> redisTemplate;
来源:oschina
链接:https://my.oschina.net/u/3632227/blog/3012432