jetcache
jetcache copied to clipboard
项目依赖jetcache-starter-redis从2.5.15升级到2.6.0项目启动报错循环依赖
升级前项目依赖如下:
springboot保持不变
<artifactId>spring-boot-starter-parent</artifactId>
jetcache-starter-redis
升级前
<artifactId>jetcache-starter-redis</artifactId>
升级后
<artifactId>jetcache-starter-redis</artifactId>
启动项目后报错提示循环依赖: 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'
同问
同问
同问
今天花时间修了这个问题,现在在master分支,可以试试。
试试2.6.3