Tagged articles
55 articles
Page 1 of 1
Coder Trainee
Coder Trainee
May 8, 2026 · Backend Development

How Spring Boot Instantiates Beans and Resolves Circular Dependencies

This article walks through Spring Boot's bean creation pipeline—from the initial getBean call through doGetBean, the three‑level singleton cache, and the detailed steps of createBean, populateBean, and initializeBean—explaining how circular dependencies are safely resolved and where AOP proxies are generated.

Spring Bootaopbean
0 likes · 14 min read
How Spring Boot Instantiates Beans and Resolves Circular Dependencies
Architect's Guide
Architect's Guide
Apr 5, 2026 · Backend Development

Demystifying Spring Bean Creation: From Simple Instantiation to Three‑Level Caching

This article breaks down Spring's bean lifecycle, explaining the minimal creation steps, the role of BeanFactoryPostProcessor and BeanPostProcessor, how Spring resolves bean references, handles circular dependencies with three‑level caches, and clarifies common misconceptions about proxy generation.

PostProcessorThree-level Cachebean-lifecycle
0 likes · 14 min read
Demystifying Spring Bean Creation: From Simple Instantiation to Three‑Level Caching
Architect's Guide
Architect's Guide
Dec 21, 2025 · Backend Development

How Spring Solves Circular Dependencies: Inside the Three‑Level Cache

This article provides a detailed walkthrough of Spring's circular‑dependency resolution, explaining the three‑level cache mechanism, step‑by‑step bean creation flow, and the underlying source‑code logic, complete with diagrams and code examples for deep understanding.

Three-level Cacheaopcircular-dependency
0 likes · 12 min read
How Spring Solves Circular Dependencies: Inside the Three‑Level Cache
Architect
Architect
Dec 7, 2025 · Backend Development

How Spring Breaks Circular Dependencies: A Deep Dive into the 3‑Level Cache

This article explains Spring's circular‑dependency problem, introduces the three‑level cache (singletonObjects, earlySingletonObjects, singletonFactories), walks through the full execution flow with code examples, and clarifies why each cache level and AOP proxy factories are essential for correct bean initialization.

BeanFactoryThree-level Cacheaop
0 likes · 12 min read
How Spring Breaks Circular Dependencies: A Deep Dive into the 3‑Level Cache
DeWu Technology
DeWu Technology
Oct 22, 2025 · Backend Development

Why Spring’s Circular Dependency Can Crash Your Service and How to Fix It

A backend admin service failed to start due to a Spring circular‑dependency error where a bean was injected in its raw form before AOP proxy creation, exposing the limits of Spring’s three‑level cache and prompting a detailed analysis of the root cause and practical solutions.

Bean Creationaopbackend-development
0 likes · 30 min read
Why Spring’s Circular Dependency Can Crash Your Service and How to Fix It
IT Services Circle
IT Services Circle
Jul 21, 2025 · Backend Development

How Spring Uses a Three‑Level Cache to Resolve Circular Dependencies

This article explains Spring's circular dependency problem, distinguishes when such dependencies are harmless, shows why constructor injection can still fail, and details how Spring's three‑level cache with singleton, early‑singleton, and factory caches resolves setter‑based circular dependencies, including code examples and key source snippets.

Three-level Cachecircular-dependencydependency-injection
0 likes · 10 min read
How Spring Uses a Three‑Level Cache to Resolve Circular Dependencies
Java Architect Essentials
Java Architect Essentials
Jul 6, 2025 · Backend Development

Mastering Spring Bean Circular Dependencies: 3 Real-World Solutions

This article explains Spring's three‑level cache mechanism for resolving bean circular dependencies, dives into why the cache alone is insufficient, and presents three practical scenarios with concrete solutions such as redesigning constructors, using @Lazy, and handling AOP proxy consistency.

BackendThree-level Cachebean
0 likes · 14 min read
Mastering Spring Bean Circular Dependencies: 3 Real-World Solutions
Java Captain
Java Captain
Jul 4, 2025 · Backend Development

How Does Spring Detect and Resolve Circular Bean Dependencies?

This article explains what circular dependencies are in Spring, how the framework detects them using a three‑level cache during bean creation, and walks through a step‑by‑step example of resolving a setter‑injected circular reference between two beans.

backend-developmentbean-lifecyclecircular-dependency
0 likes · 6 min read
How Does Spring Detect and Resolve Circular Bean Dependencies?
Cognitive Technology Team
Cognitive Technology Team
Mar 31, 2025 · Backend Development

Understanding Spring's Three-Level Cache Mechanism

The article explains Spring's three-level cache design—including singletonObjects, earlySingletonObjects, and singletonFactories—how it resolves circular bean dependencies, enables lazy initialization and proxy creation, outlines the workflow, and discusses its limitations and practical solutions.

Three-level Cachebackend-developmentbean-lifecycle
0 likes · 7 min read
Understanding Spring's Three-Level Cache Mechanism
Architect's Guide
Architect's Guide
Dec 6, 2024 · Backend Development

Why Spring Requires a Three‑Level Cache to Resolve Circular Dependencies Instead of a Two‑Level Cache

This article explains how Spring's bean lifecycle uses a three‑level cache (singletonObjects, earlySingletonObjects, singletonFactories) to break circular dependencies, especially when AOP proxies are involved, and why a two‑level cache alone cannot guarantee correct singleton behavior.

Three-level Cacheaopbackend-development
0 likes · 10 min read
Why Spring Requires a Three‑Level Cache to Resolve Circular Dependencies Instead of a Two‑Level Cache
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Aug 19, 2024 · Backend Development

Why Field Injection in Spring Is Risky and How Constructor Injection Solves It

The article explains how field injection in Spring can cause null‑pointer exceptions, break immutability, violate design principles, and hide circular dependencies, and demonstrates that using constructor injection (with optional @Lazy) provides safer, more maintainable dependency management.

Constructor InjectionField Injectioncircular-dependency
0 likes · 7 min read
Why Field Injection in Spring Is Risky and How Constructor Injection Solves It
Architect
Architect
Apr 28, 2024 · Backend Development

Understanding Spring's Circular Dependency Resolution with a Three‑Level Cache

This article explains how Spring solves circular dependencies by using a three‑level cache system, walks through the underlying source‑code execution flow, clarifies the purpose of each cache level, and discusses why the design is essential for AOP‑enabled beans.

BeanFactoryThree-level Cacheaop
0 likes · 12 min read
Understanding Spring's Circular Dependency Resolution with a Three‑Level Cache
政采云技术
政采云技术
Dec 12, 2023 · Backend Development

Understanding Spring's Circular Dependency Resolution via Three-Level Caches

This article explains how Spring handles common circular dependencies between singleton Beans by employing a three‑level cache (singletonObjects, earlySingletonObjects, singletonFactories), detailing the prerequisites, cache structures, workflow, and key source code snippets that illustrate the underlying mechanism.

Three-level Cachebackend-developmentbean
0 likes · 10 min read
Understanding Spring's Circular Dependency Resolution via Three-Level Caches
Programmer DD
Programmer DD
May 23, 2023 · Backend Development

How to Detect and Resolve Circular Dependencies in Spring Boot

This article explains what circular dependencies are in Spring Boot, describes the symptoms and errors introduced in recent versions, and provides multiple practical solutions—including constructor injection, @Lazy, @DependsOn, and interface segregation—along with clear code examples for each approach.

@LazySpring Bootbackend-development
0 likes · 8 min read
How to Detect and Resolve Circular Dependencies in Spring Boot
Alibaba Cloud Developer
Alibaba Cloud Developer
May 6, 2023 · Backend Development

Why Spring Throws Circular Dependency Errors and How to Fix Them

This article explains the causes of Spring circular dependency exceptions, details how Spring's three‑level cache and AOP proxy mechanisms contribute to the problem, and provides practical solutions such as using @Lazy, refactoring code, and ensuring a single AutoProxyCreator to prevent bean creation failures.

Bean Creationaopcircular-dependency
0 likes · 22 min read
Why Spring Throws Circular Dependency Errors and How to Fix Them
Top Architect
Top Architect
Apr 25, 2023 · Backend Development

Understanding and Resolving Circular Dependencies in Spring Boot

This article explains what circular dependencies are in Spring Boot, why they cause startup failures from version 2.6 onward, and presents several practical solutions—including constructor injection, setter injection, @Lazy, @Autowired(required=false), @DependsOn, and interface segregation—accompanied by code examples.

circular-dependencydependency-injectionspring-boot
0 likes · 10 min read
Understanding and Resolving Circular Dependencies in Spring Boot
Selected Java Interview Questions
Selected Java Interview Questions
Jan 18, 2023 · Backend Development

Analyzing and Resolving Circular Dependency Causing SocketTimeoutException in SpringBoot Microservices

The article investigates a SocketTimeoutException caused by a circular dependency between two SpringBoot microservices, explains how the deadlock occurs, demonstrates a reproducible test setup with Eureka, FeignClient and JMeter, and provides a concrete code‑level fix to break the loop.

BackendFeignClientcircular-dependency
0 likes · 8 min read
Analyzing and Resolving Circular Dependency Causing SocketTimeoutException in SpringBoot Microservices
Code Ape Tech Column
Code Ape Tech Column
Jan 11, 2023 · Backend Development

Resolving SocketTimeoutException Caused by Circular Dependency in Spring Cloud Microservices

The article analyzes a SocketTimeoutException occurring in a test environment due to a circular dependency between two Spring Cloud microservices, demonstrates how removing the circular call eliminates the timeout, and provides verification steps with code, JMeter load testing, and thread‑dump analysis.

FeignClientcircular-dependencyeureka
0 likes · 9 min read
Resolving SocketTimeoutException Caused by Circular Dependency in Spring Cloud Microservices
Top Architect
Top Architect
Jul 19, 2022 · Backend Development

How Spring Resolves Circular Dependencies Using Early Exposure and Three‑Level Caches

The article explains Spring's three‑level cache mechanism—singletonObjects, earlySingletonObjects, and singletonFactories—and how early exposure combined with BeanPostProcessor hooks enables the framework to break circular dependencies while still applying AOP proxies before full bean initialization.

BeanPostProcessorThree-level Cacheaop
0 likes · 13 min read
How Spring Resolves Circular Dependencies Using Early Exposure and Three‑Level Caches
Top Architect
Top Architect
Jun 12, 2022 · Backend Development

How Spring Resolves Circular Dependencies Using Early Exposure and a Three‑Level Cache

This article explains Spring's circular‑dependency solution, detailing the early‑exposure mechanism, the three‑level cache (singletonObjects, earlySingletonObjects, singletonFactories), how BeanPostProcessors and AOP proxies interact during bean creation, and why the third‑level cache is essential for correct bean wiring.

BeanPostProcessorThree-level Cacheaop
0 likes · 14 min read
How Spring Resolves Circular Dependencies Using Early Exposure and a Three‑Level Cache
Sanyou's Java Diary
Sanyou's Java Diary
May 22, 2022 · Backend Development

How Spring’s Three‑Level Cache Solves Circular Dependencies

This article explains what circular dependencies are in Spring, describes the three‑level cache mechanism (singletonObjects, earlySingletonObjects, singletonFactories), shows how it resolves singleton bean cycles, and outlines scenarios where the cache cannot break the dependency, such as constructor injection and prototype beans.

Three-level Cachebean-lifecyclecircular-dependency
0 likes · 14 min read
How Spring’s Three‑Level Cache Solves Circular Dependencies
Cognitive Technology Team
Cognitive Technology Team
Mar 25, 2022 · Backend Development

Resolving Circular Dependency Issues in SpringBoot: Causes, Exceptions, and Practical Solutions

This article explains why SpringBoot throws BeanCurrentlyInCreationException when circular dependencies arise, especially with constructor injection, and provides multiple mitigation techniques such as disabling the restriction, using @Lazy, setter injection, and direct ApplicationContext bean retrieval.

SpringBootcircular-dependencydependency-injection
0 likes · 3 min read
Resolving Circular Dependency Issues in SpringBoot: Causes, Exceptions, and Practical Solutions
Top Architect
Top Architect
Mar 21, 2022 · Backend Development

How Spring Resolves Bean Circular Dependencies with a Three‑Level Cache

This article explains Spring's bean lifecycle, the three‑level cache mechanism (singletonObjects, earlySingletonObjects, singletonFactories) used to break circular dependencies, the role of Aware interfaces and BeanPostProcessor, and why a second‑level cache is essential when AOP proxies are involved.

Three-level Cacheaopbackend-development
0 likes · 9 min read
How Spring Resolves Bean Circular Dependencies with a Three‑Level Cache
Programmer DD
Programmer DD
Mar 21, 2022 · Backend Development

Why Spring’s Bean Scanning Can Trigger Unresolvable Circular References (and How to Fix It)

This article examines how Spring Boot 2.0.3 resolves (or fails to resolve) setter‑based circular dependencies, explores bean definition scanning order, bean definition overriding, and instantiation sequence that can lead to an “unresolvable circular reference” error, and then shifts to explain ZGC’s mark‑compact algorithm, its evolution before and after JDK 16, and its performance characteristics.

bean-scanningcircular-dependencyjava-gc
0 likes · 14 min read
Why Spring’s Bean Scanning Can Trigger Unresolvable Circular References (and How to Fix It)
macrozheng
macrozheng
Mar 17, 2022 · Backend Development

How to Upgrade Spring Boot to 2.6.x Without Circular Dependency and Swagger Issues

This article walks through upgrading a Spring Boot project to version 2.6.x, explains why circular bean dependencies and Swagger failures occur after the upgrade, and provides step‑by‑step configuration changes—including allowing circular references, using @Lazy, and adjusting MVC path‑matching—to resolve the problems.

Spring BootSwaggerbackend-development
0 likes · 7 min read
How to Upgrade Spring Boot to 2.6.x Without Circular Dependency and Swagger Issues
DaTaobao Tech
DaTaobao Tech
Feb 28, 2022 · Frontend Development

Understanding ESModule Loading and Execution Process

ESModules load by fetching and parsing files to build a static dependency graph, then instantiate bindings before evaluating each module depth‑first, which ensures deterministic execution, enables concurrent loading and TreeShaking, and explains why circular imports can cause temporal‑dead‑zone ReferenceErrors when exported variables are accessed before initialization.

ESModuleFront-endJavaScript
0 likes · 10 min read
Understanding ESModule Loading and Execution Process
Java Captain
Java Captain
Feb 24, 2022 · Backend Development

How Spring Solves Bean Circular Dependencies Using a Three-Level Cache

This article explains how Spring's bean lifecycle and its three-level caching mechanism—singletonObjects, earlySingletonObjects, and singletonFactories—work together to resolve circular dependencies, especially when AOP proxies are involved, highlighting why a three‑cache approach is necessary.

Three-level Cacheaopbackend-development
0 likes · 9 min read
How Spring Solves Bean Circular Dependencies Using a Three-Level Cache
Java Architect Essentials
Java Architect Essentials
Nov 30, 2021 · Backend Development

How Spring Solves Circular Dependencies and the Underlying Essence

This article explains Spring's three‑level cache mechanism for breaking circular dependencies in singleton beans, demonstrates a simplified implementation with Java code, draws an analogy to the classic Two‑Sum algorithm, and highlights the core idea behind dependency injection.

Two Sumcircular-dependencydependency-injection
0 likes · 9 min read
How Spring Solves Circular Dependencies and the Underlying Essence
ELab Team
ELab Team
Aug 6, 2021 · Fundamentals

Fixing JS Module Errors: CommonJS vs ES6 and Circular Dependency Solutions

This article examines why JavaScript applications encounter runtime errors when using CommonJS or ES6 modules, explains the underlying module loading mechanisms, highlights pitfalls of circular dependencies, and provides practical solutions—including webpack plugins and code adjustments—to reliably resolve such issues.

CommonJSModulescircular-dependency
0 likes · 20 min read
Fixing JS Module Errors: CommonJS vs ES6 and Circular Dependency Solutions
Programmer DD
Programmer DD
Jun 25, 2021 · Backend Development

How Spring Solves Circular Dependencies: Inside the Three‑Level Cache

This article explains why Spring’s default singleton beans can handle circular references, describes the three‑level cache mechanism that makes it possible, shows prototype limitations, provides a minimal implementation example, and even relates the solution to the classic two‑sum algorithm.

Three-level CacheTwo Sumcircular-dependency
0 likes · 9 min read
How Spring Solves Circular Dependencies: Inside the Three‑Level Cache
Top Architect
Top Architect
Mar 3, 2021 · Backend Development

How Spring Solves Circular Dependencies and the Underlying Essence

This article explains Spring's approach to resolving circular dependencies in singleton beans using a three‑level cache, contrasts it with prototype bean limitations, provides a simplified implementation example, and draws an analogy to the classic two‑sum algorithm to illustrate the core concept.

BackendDesign PatternsSingleton
0 likes · 9 min read
How Spring Solves Circular Dependencies and the Underlying Essence
Java Captain
Java Captain
Feb 13, 2021 · Backend Development

How Spring Solves Circular Dependencies and the Underlying Essence

This article explains how Spring resolves circular dependencies in singleton beans using a three‑level cache, contrasts it with prototype beans, provides a minimal reflective implementation, and draws an analogy to the classic two‑sum algorithm to illustrate the core principle.

BackendDesign Patternscircular-dependency
0 likes · 9 min read
How Spring Solves Circular Dependencies and the Underlying Essence
Code Ape Tech Column
Code Ape Tech Column
Jan 7, 2021 · Backend Development

How Spring Solves Circular Dependencies: Inside the Three‑Cache Mechanism

This article explains how Spring resolves circular dependencies for singleton beans using a three‑level cache, contrasts it with prototype limitations, provides a minimal container implementation that mimics the mechanism, and draws an analogy to the classic two‑sum algorithm to illustrate the core caching principle.

BackendThree CacheTwo Sum
0 likes · 11 min read
How Spring Solves Circular Dependencies: Inside the Three‑Cache Mechanism
Programmer DD
Programmer DD
Aug 11, 2020 · Backend Development

Mastering Spring’s Circular Dependency: How the Three-Level Cache Solves Bean Loops

This article explains Spring's circular dependency problem, the conditions under which it can be resolved, and how Spring's three‑level cache—combined with AOP proxy handling—enables beans to reference each other without causing creation failures, providing a comprehensive answer for interview scenarios.

Three-level Cacheaopbean-lifecycle
0 likes · 18 min read
Mastering Spring’s Circular Dependency: How the Three-Level Cache Solves Bean Loops
Top Architect
Top Architect
Jul 21, 2020 · Backend Development

How Spring Solves Circular Dependencies and the Underlying Essence

This article explains how Spring resolves circular dependencies for singleton beans using a three‑level cache, demonstrates a simple prototype implementation, draws an analogy to the classic two‑sum algorithm, and highlights the core principle behind Spring's dependency injection mechanism.

BackendThree-level Cachecircular-dependency
0 likes · 9 min read
How Spring Solves Circular Dependencies and the Underlying Essence
Architecture Digest
Architecture Digest
Jul 18, 2020 · Backend Development

Understanding How Spring Handles Circular Dependencies and Its Core Principle

This article explains Spring's three‑level cache mechanism for resolving circular dependencies in singleton beans, demonstrates a simplified implementation with Java code, draws an analogy to the classic two‑sum algorithm, and highlights the essential idea behind circular dependency handling.

circular-dependencydependency-injectiondesign pattern
0 likes · 9 min read
Understanding How Spring Handles Circular Dependencies and Its Core Principle
macrozheng
macrozheng
Jul 16, 2020 · Backend Development

Master Spring’s Circular Dependency: How the Three‑Level Cache Resolves It

This article explains what circular dependency means in Spring, the conditions under which it can be resolved, and walks through the three‑level cache mechanism—including simple cases and AOP‑enhanced scenarios—providing code examples, diagrams, and a clear summary for interview preparation.

Three-level Cacheaopbean-lifecycle
0 likes · 19 min read
Master Spring’s Circular Dependency: How the Three‑Level Cache Resolves It
macrozheng
macrozheng
May 9, 2020 · Backend Development

How Does Spring Resolve Circular Dependencies? Inside the Three‑Level Cache

This article explains how Spring handles circular dependencies in singleton beans by using a three‑level cache, contrasts it with prototype beans that cannot participate, and demonstrates a minimal implementation that mimics Spring's approach, linking the concept to the classic two‑sum algorithm.

Three-level Cachebackend-developmentcircular-dependency
0 likes · 10 min read
How Does Spring Resolve Circular Dependencies? Inside the Three‑Level Cache
Java Captain
Java Captain
May 4, 2020 · Backend Development

How Spring Solves Circular Dependencies and the Underlying Essence

This article explains how Spring resolves circular dependencies for singleton beans using a three‑level cache, demonstrates a simple prototype implementation that mimics Spring's behavior, and relates the problem to the classic two‑sum algorithm to reveal its fundamental nature.

Two Sumbeancircular-dependency
0 likes · 9 min read
How Spring Solves Circular Dependencies and the Underlying Essence
Java Backend Technology
Java Backend Technology
May 3, 2020 · Backend Development

How Spring Solves Circular Dependencies: The 3‑Cache Trick Explained

This article explains how Spring resolves circular dependencies in singleton beans using a three‑level cache, why prototype beans cannot participate, provides a minimal example implementation, and draws an analogy to the classic two‑sum algorithm to illustrate the underlying principle.

BackendThree Cachecircular-dependency
0 likes · 10 min read
How Spring Solves Circular Dependencies: The 3‑Cache Trick Explained
Java Backend Technology
Java Backend Technology
Apr 23, 2020 · Backend Development

Why Spring’s Constructor Injection Fails on Circular Dependencies (and How Setters Help)

This article explains what circular dependencies are in Spring, shows three ways the framework handles them—constructor injection, singleton setter injection, and prototype setter injection—illustrates each with Java classes and XML configuration, and clarifies why only the singleton setter approach avoids runtime errors.

Bean ScopeConstructor InjectionSetter Injection
0 likes · 9 min read
Why Spring’s Constructor Injection Fails on Circular Dependencies (and How Setters Help)