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

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

  •  
  •   hackingwu ·
    hackingwu · Oct 13, 2021 · 2333 views
    This topic created in 1761 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
        1
    mouxiaoshi  
       Oct 14, 2021
    这不就找到一个循环依赖包了?[狗头]
    Cestbonmmm
        2
    Cestbonmmm  
       Oct 14, 2021
    看单个 bean 是否有循环依赖的话,IDEA 的 sidebar 里自带 spring - beans 里可以查看。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3093 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:12 · PVG 21:12 · LAX 06:12 · JFK 09:12
    ♥ Do have faith in what you're doing.