RedisTemplate<String, Object> template = newRedisTemplate<>();为什么报错
时间: 2024-06-12 21:09:50 浏览: 161
RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory)
可能是因为缺少相关的依赖,需要添加相应的Redis依赖,例如jedis或lettuce等。您可以尝试在pom.xml中添加以下依赖之一:
```
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>6.1.3.RELEASE</version>
</dependency>
```
阅读全文