ERROR o.s.boot.SpringApplication - Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dictApplication': Unsatisfied dependency expressed through field 'dictService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dictService': Unsatisfied dependency expressed through field 'stringRedisTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stringRedisTemplate' defined in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'stringRedisTemplate' parameter 0; nested exception is 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
时间: 2024-02-12 20:19:21 浏览: 385
测试spring中的org.springframework.beans.factory.InitializingBean
这个错误是应用程序在启动时发生的。看起来像是依赖项的问题,具体来说是redis。应用程序无法创建名为'dictApplication'的bean,因为它的依赖项'dictService'无法满足。dictService依赖于stringRedisTemplate,但stringRedisTemplate也有未满足的依赖项。该错误可能与redisConnectionFactory的创建有关。在创建redisConnectionFactory时,出现了一个NoClassDefFoundError。这可能是由于缺少commons-pool2依赖项导致的。你可以尝试添加commons-pool2依赖项来解决此问题。
阅读全文