1、springboot使用版本
<version>2.0.1.RELEASE</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/>
</parent>
2、报错原因
使用@Autowired注解
@Autowired
private RedisTemplate redisTemplate;
3、解决方法
使用@Resource注解
@Resource
private RedisTemplate redisTemplate;