Error creating bean with name ‘redisConnectionFactory‘ defined in class path resource...

[org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory]: Factory method ‘redisConnectionFactory’ threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig
在这里插入图片描述
出现这个原因是因为lettuce池底层使用了commons-pool2,所以需要导入这个依赖

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>

导入这个依赖即可

猜你喜欢

转载自blog.csdn.net/Kevinnsm/article/details/124355095