Requested bean is currently in creation: Is there an unresolvable circular reference?
时间: 2023-08-19 20:17:07 浏览: 167
IIS访问ASP页面时报错The requested resource is in use.的解决办法
5星 · 资源好评率100%
回答: "Requested bean is currently in creation: Is there an unresolvable circular reference?" 这个错误通常是由于Spring容器中存在循环依赖引起的。循环依赖是指两个或多个bean之间相互依赖,而且无法通过简单的初始化顺序解决。\[1\]\[2\]为了解决这个问题,可以在其中一个bean上添加@Lazy注解,延迟加载其中一个bean,从而解决Spring在初始化bean时无法确定先初始化哪个的问题。\[3\]通过使用@Lazy注解,可以推迟依赖的bean的加载,从而避免循环依赖的问题。
#### 引用[.reference_title]
- *1* [Requested bean is currently in creation: Is there an unresolvable circular reference? 原因之一(java...](https://blog.csdn.net/sinat_37792529/article/details/131573638)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Requested bean is currently in creation: Is there an unresolvable circular reference?](https://blog.csdn.net/WY_cat/article/details/102929469)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Requested bean is currently in creation: Is there an unresolvable circular reference?(循环依赖报错...](https://blog.csdn.net/qq_61544409/article/details/128603136)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文