Welcome to my website, have a nice day!
Dream it, Do it, Make it!

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

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>
赞(0)
未经允许禁止转载:Ddmit » Springboot集成redis报错:java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址