• 请不要在回答技术问题时复制粘贴 AI 生成的内容
hackingwu
V2EX  ›  程序员

spring boot 项目有什么工具,或者办法可以分析当下项目里 Bean 是否存在循环依赖

  •  
  •   hackingwu ·
    hackingwu · Oct 13, 2021 · 2418 views
    This topic created in 1867 days ago, the information mentioned may be changed or developed.

    spring 项目是支持循环依赖的,我想检测一下自己项目的 Bean 是否有循环依赖。 我把 spring 循环依赖支持关闭 setAllowCircularReferences(false),通过 spring 报错来看自己项目中有存在的循环依赖,但是发现 DataSource 本身有循环依赖,项目无法启动。 除了这个还有其他更好的办法吗?

    2 replies  •  2021-10-14 10:55:11 +08:00
    mouxiaoshi
    mouxiaoshi
    Oct 14, 2021
    1
    这不就找到一个循环依赖包了?[狗头]
    Cestbonmmm
    Cestbonmmm
    Oct 14, 2021
    2
    看单个 bean 是否有循环依赖的话,IDEA 的 sidebar 里自带 spring - beans 里可以查看。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   947 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:54 · PVG 03:54 · LAX 11:54 · JFK 14:54
    ♥ Do have faith in what you're doing.