gpt4 book ai didi

java - 查找 spring bean 之间循环依赖的良好实践

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:42:19 26 4
gpt4 key购买 nike

我有这个异常(exception):

SEVERE: Context initialization failedorg.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'myService': Bean with name 'myService' has been injected into other beans [otherService] 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.

谁能提出找到循环依赖来源的好策略?

我目前正在查看上下文定义,但正如您可能想象的那样,在某个成熟的项目中这需要相当长的时间。

所以我通常在寻找有关快速查找循环 bean 依赖项的想法。

最佳答案

这里有 2 个宣传依赖图生成的工具。然而,我对它们没有任何经验。

关于java - 查找 spring bean 之间循环依赖的良好实践,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8402140/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com