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

标签 java spring circular-dependency

我有这个异常(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/

相关文章:

java - Tomcat 上的 Eclipse Scout Http 部署失败

Java/Swing : Update data on stateChange

java - Spring/RestTemplate - PUT 实体到服务器

java - 启动过滤器 struts2 时出现异常 无法加载配置。怎么了?

java - HibernateCallback 最适合执行 SQL/过程吗?

angular - ionic 应用程序中的循环依赖

java - 如何删除这种循环类依赖?

C中函数指针typedef的循环引用

java - 如何在 ListView 中从 Firebase 获取最后 50 个元素?

java - response.sendredirect 中的空指针异常