我正在使用Redis并创建了HttpSessionConfig文件。这是我的代码

HttpSessionConfig.java:

@EnableRedisHttpSession
public class HttpSessionConfig {

    @Bean
    public LettuceConnectionFactory connectionFactory() {

        return new LettuceConnectionFactory();
    }

    @Bean
    public HttpSessionIdResolver httpSessionStrategy() {
        return HeaderHttpSessionIdResolver.authenticationInfo();
    }

}

这是我的pom.xml文件:
    <!-- Redis -->
    <dependency>
        <groupId>org.springframework.session</groupId>
        <artifactId>spring-session-data-redis</artifactId>
    </dependency>

    <dependency>
        <groupId>biz.paluch.redis</groupId>
        <artifactId>lettuce</artifactId>
        <version>4.3.1.Final</version>
    </dependency>

但是我得到了错误:



更多跟踪:



谁知道怎么修它 ???

最佳答案

在堆栈跟踪中,错误表明



因此,在pom.xml中手动添加依赖项io.lettuce

<dependency>
    <groupId>io.lettuce</groupId>
    <artifactId>lettuce-core</artifactId>
    <version>5.1.7.RELEASE</version>
</dependency>

10-06 09:01