优米格
分享有营养的

Springboot集成redis报错:java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig

BraUndress.png

Springboot集成redis报错信息如下:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource [org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory]: Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig

原因:缺少依赖。

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-pool2</artifactId>
</dependency>
赞(3)
未经允许禁止转载:优米格 » Springboot集成redis报错:java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig

评论 抢沙发

合作&反馈&投稿

商务合作、问题反馈、投稿,欢迎联系

广告合作侵权联系