admin管理员组文章数量:1534214
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderEvaluateStatisticsServiceImpl': Unsatisfied dependency expressed through field 'orderInfoService'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'orderInfoServiceImpl': Bean with name 'orderInfoServiceImpl' has been injected into other beans [messageLogServiceImpl,callRecordServiceImpl,shopInfoServiceImpl] 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, for example.
但是我在本地运行并没有出现问题、只是服务器部署出现。
has been injected into other beans 从字面上意义可以了解出,存在多版本的不同实例(topicService)
具体原因不知
解决方案
在注入@Autowired 下加@Lazy 注解即可(两边都加比较保险)
当然, 最好的解决办法是进行解耦。
但,如果改动比较大,可以在你的配置文件中,在互相依赖的两个bean的任意一个加上lazy-init属性
或者在你注意bean 的时候,在互相依赖的两个bean上加上@Lazy注解也可以。
@Autowired @Lazy
private ClassA classA;
@Autowired @Lazy
private ClassB classB;
本文标签: VersionRAWPartreferencecircular
版权声明:本文标题:循环依赖 in its raw version as part of a circular reference 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1726872990a1088044.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论