admin管理员组文章数量:1534194
今天在项目编码过程中,出现了下面的异常:
org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name 'systemService':
Bean with name 'systemService' has been injected into other beans [yeeDoctorsImpactService] in its raw version as part of a circular reference,
but has eventually been wrapped.
This means that said other beans do not use the final version of the bean.
This is often the result of over-eager type matching -
consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off
1、原因: systemService 类中注入了 yeeDoctorsImpactService , 而在 yeeDoctorsImpactService 类中也注入了 systemService ,从而引起该异常。(循环引用)
2、解决: systemService 类注入 yeeDoctorsImpactService 时,增加注解@Lazy,反之同理。
在平时的项目编码过程中,尽量不要导致循环依赖。
本文标签: beansRAWbeaninjectedcircular
版权声明:本文标题:Bean with name '' has been injected into other beans [] in its raw version as part of a circular ref 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1726873170a1088062.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论