Skip to content
Tagged articles

Bean Overriding

5 articles · Page 1 of 1
Java Architect Handbook
Java Architect Handbook
Jan 11, 2026 · Backend Development

Why @Configuration + @Bean Overrides @Component in Spring Boot: Deep Dive and Version Differences

A detailed analysis shows that when a class is annotated with both @Configuration/@Bean and @Component, Spring creates only one bean—the one defined by @Configuration/@Bean—overriding the @Component definition, and explains how this behavior changed across Spring and Spring Boot versions.

@ComponentBean OverridingConfiguration
0 likes · 10 min read
Why @Configuration + @Bean Overrides @Component in Spring Boot: Deep Dive and Version Differences
Selected Java Interview Questions
Selected Java Interview Questions
Apr 18, 2024 · Backend Development

Understanding @Configuration vs @Component Bean Overriding in Spring Boot 2.0.3

This article explains why a Spring Boot 2.0.3 application creates two UserManager beans when both @Configuration + @Bean and @Component are used, how the container decides which instance is injected, and how newer Spring versions allow developers to control bean‑definition overriding via configuration.

@ComponentBackend DevelopmentBean Overriding
0 likes · 8 min read
Understanding @Configuration vs @Component Bean Overriding in Spring Boot 2.0.3
Java Architect Essentials
Java Architect Essentials
Jul 10, 2022 · Backend Development

Why @Configuration + @Bean Overrides @Component in Spring Boot and How Bean Definition Overriding Evolved

This article explains why, in Spring Boot 2.0.3, a bean defined with @Configuration + @Bean replaces a @Component‑annotated bean of the same type, shows how to verify which bean is instantiated, and describes the framework’s evolution—including the allowBeanDefinitionOverriding setting—that gives developers control over bean overriding behavior.

@ComponentBean OverridingJava
0 likes · 7 min read
Why @Configuration + @Bean Overrides @Component in Spring Boot and How Bean Definition Overriding Evolved
Programmer DD
Programmer DD
Jul 6, 2022 · Backend Development

Why Does Spring Create Two UserManager Beans? Uncovering @Configuration vs @Component Behavior

This article explains why a Spring Boot application can end up with two UserManager beans—one from @Configuration + @Bean and another from @Component—by analyzing bean definition overriding, the role of ConfigurationClassPostProcessor, and the impact of the allowBeanDefinitionOverriding setting across Spring versions.

@ComponentBackend DevelopmentBean Overriding
0 likes · 9 min read
Why Does Spring Create Two UserManager Beans? Uncovering @Configuration vs @Component Behavior
Java Backend Technology
Java Backend Technology
Mar 18, 2022 · Backend Development

Why @Configuration @Bean Overrides @Component in Spring Boot 2.0.3

An in‑depth analysis shows that in Spring Boot 2.0.3 a @Configuration class defining a @Bean can override a @Component‑annotated bean of the same type, how the Spring container registers and replaces the bean definitions, and the evolution of bean‑overriding controls in later Spring and Spring Boot releases.

@ComponentBackend DevelopmentBean Overriding
0 likes · 8 min read
Why @Configuration @Bean Overrides @Component in Spring Boot 2.0.3