redis配置类报Could not autowire. No beans of ‘RedisConnectionFactory‘ type found.

@Configuration
public class RedisConfig {
@Bean
@SuppressWarnings(value = {“unchecked”,“rawtypes”})
public RedisTemplate redisTemplate(RedisConnectionFactory factory){
RedisTemplate template=new RedisTemplate<>();
template.setConnectionFactory(factory);
FastJsonRedisSerializer serializer=new FastJsonRedisSerializer(Object.class);
template.setKeySerializer(new StringRedisSerializer());
template.setValueSerializer(serializer);
template.setHashKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(serializer);
template.afterPropertiesSet();
return template;
}
}
redis配置类报Could not autowire. No beans of ‘RedisConnectionFactory‘ type found._第1张图片
由于这个包忘记引入redis配置类报Could not autowire. No beans of ‘RedisConnectionFactory‘ type found._第2张图片

你可能感兴趣的:(Springboot,redis,缓存,数据库)