redis结合springboot 没法注入redisTemplate问题

redis结合springboot 没法注入redisTemplate问题

 

报错:html

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)}java

以前是,redis

@Autowired
private RedisTemplate<String, Object> redisTemplate;

 

改为spring

@Resource
private RedisTemplate<String, Object> redisTemplate;
相关文章
相关标签/搜索