jetcache icon indicating copy to clipboard operation
jetcache copied to clipboard

项目依赖jetcache-starter-redis从2.5.15升级到2.6.0项目启动报错循环依赖

Open xlzlyyy opened this issue 2 years ago • 5 comments

升级前项目依赖如下: springboot保持不变 <artifactId>spring-boot-starter-parent</artifactId> 2.2.5.RELEASE

jetcache-starter-redis 升级前 <artifactId>jetcache-starter-redis</artifactId> 2.5.15 指定jedis为低版本 <artifactId>jedis</artifactId> 2.9.0

升级后 <artifactId>jetcache-starter-redis</artifactId> 2.6.0 并去掉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'

xlzlyyy avatar Oct 12 '21 07:10 xlzlyyy

同问

miaoyinjun avatar Nov 29 '21 06:11 miaoyinjun

同问

thorlove avatar Dec 06 '21 07:12 thorlove

同问

thorlove avatar Dec 06 '21 07:12 thorlove

今天花时间修了这个问题,现在在master分支,可以试试。

areyouok avatar Apr 06 '22 13:04 areyouok

试试2.6.3

areyouok avatar Apr 09 '22 14:04 areyouok