工程启动报错提示循环依赖

Blade 未结 3 1120
Echo简若宁
Echo简若宁 剑童 2021-06-19 15:55

官网拉去代码后,启动UserApplication服务,运行报错,提示依赖循环。这个怎么处理?

异常信息:

Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'org.springblade.system.feign.ISysClient': Requested bean is currently in creation: Is there an unresolvable circular reference?

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:355)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:227)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)

at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154)

at com.alibaba.cloud.sentinel.feign.SentinelFeign$Builder$1.create(SentinelFeign.java:84)

at feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:64)

at feign.Feign$Builder.target(Feign.java:269)

at org.springframework.cloud.openfeign.DefaultTargeter.target(DefaultTargeter.java:30)

at org.springframework.cloud.openfeign.FeignClientFactoryBean.loadBalance(FeignClientFactoryBean.java:330)

at org.springframework.cloud.openfeign.FeignClientFactoryBean.getTarget(FeignClientFactoryBean.java:360)

at org.springframework.cloud.openfeign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:339)

at org.springframework.cloud.openfeign.FeignClientsRegistrar.lambda$registerFeignClient$0(FeignClientsRegistrar.java:230)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1231)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1173)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300)

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)

... 34 common frames omitted


3条回答
  • 2021-06-21 17:31

    如果没有改动的话只想 mvn clean install再跑一下,如果有改动则需要贴出改动的地方才能帮忙判断

    0 讨论(0)
  • 2021-06-24 19:07

    代码是官网上拉去下来的,没有改动。

    回答: 2021-06-24 19:16

     mvn clean install 运行也是报错,启动是否有顺序?

    0 讨论(0)
  • 2023-08-16 17:44

    升级了3.1.1之后,官方把user服务放到了system中,结果启动system服务居然又循环依赖的低级错误,不知道这个版本是怎么发布的。加上代码生成器的bug,以上两个是发现的比较严重的问题,这么久官方都没发现,还发布为release版本,无语

    77770a23d62411b69bf70cbb577b14f.png

    作者追问:2023-08-16 17:48

    你下一个私服的master原版,看看有没有报错。会不会是你升级后,有地方没有处理好导致的错误。

    如果真有问题,后续的新用户启动发现的第一时间就会反馈给我们了,但是我们从未收到过system循环依赖的问题

    image.png

    0 讨论(0)
提交回复