若只配置下面的依赖:
1 2 3 4
| <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>
|
则为出现:
Unsatisfied dependency expressed through field ‘redisTemplate‘;
这个不对,还必须加上 commons-pool2,修改以后是
1 2 3 4 5 6 7 8 9
| <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </dependency>
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>
|