启动项目后报错提示循环依赖:
WARN 2021-10-12 15:34:08.140 16504 AbstractApplicationContext.java:558 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexShiroConfiguration': Unsatisfied dependency expressed through field 'resourceService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceServiceImpl': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'globalCacheConfig' defined in class path resource [com/alicp/jetcache/autoconfigure/JetCacheAutoConfiguration.class]: Circular depends-on relationship between 'globalCacheConfig' and 'com.alicp.jetcache.autoconfigure.LinkedHashMapAutoConfiguration'
尝试过再启动类上加上包扫描
@ComponentScan(basePackages = {"com.alicp.jetcache.autoconfigure","xx自己的业务包名xx"})
启动依然包循环依赖,只是依赖的bean换了
WARN 2021-10-12 15:40:44.194 17116 AbstractApplicationContext.java:558 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexShiroConfiguration': Unsatisfied dependency expressed through field 'resourceService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceServiceImpl': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'globalCacheConfig' defined in class path resource [com/alicp/jetcache/autoconfigure/JetCacheAutoConfiguration.class]: Circular depends-on relationship between 'globalCacheConfig' and 'redisAutoInit'
升级前项目依赖如下: springboot保持不变
jetcache-starter-redis 升级前
指定jedis为低版本
升级后
并去掉jedis的指定版本
启动项目后报错提示循环依赖: WARN 2021-10-12 15:34:08.140 16504 AbstractApplicationContext.java:558 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexShiroConfiguration': Unsatisfied dependency expressed through field 'resourceService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceServiceImpl': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'globalCacheConfig' defined in class path resource [com/alicp/jetcache/autoconfigure/JetCacheAutoConfiguration.class]: Circular depends-on relationship between 'globalCacheConfig' and 'com.alicp.jetcache.autoconfigure.LinkedHashMapAutoConfiguration'
尝试过再启动类上加上包扫描 @ComponentScan(basePackages = {"com.alicp.jetcache.autoconfigure","xx自己的业务包名xx"}) 启动依然包循环依赖,只是依赖的bean换了 WARN 2021-10-12 15:40:44.194 17116 AbstractApplicationContext.java:558 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexShiroConfiguration': Unsatisfied dependency expressed through field 'resourceService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceServiceImpl': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'globalCacheConfig' defined in class path resource [com/alicp/jetcache/autoconfigure/JetCacheAutoConfiguration.class]: Circular depends-on relationship between 'globalCacheConfig' and 'redisAutoInit'