Tag

Bean

0 views collected around this technical thread.

Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Nov 1, 2024 · Backend Development

How to Create Multiple Beans of the Same Class in Spring Boot 3

This article demonstrates several techniques—including @Bean methods, @Component inheritance, BeanFactoryPostProcessor, and custom FactoryBean implementations—to instantiate multiple beans of the same class in a Spring Boot 3 application, comparing their advantages and limitations.

BeanJavaSpring Boot
0 likes · 8 min read
How to Create Multiple Beans of the Same Class in Spring Boot 3
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jul 5, 2024 · Backend Development

How to Resolve Common Spring Boot Configuration Pitfalls and Circular Dependency Errors

This article explains why @Configuration classes can cause circular dependency and custom BeanPostProcessor issues in Spring Boot, and provides practical solutions such as enabling circular references, using static @Bean methods, and preferring constructor injection for reliable bean injection.

BeanBeanPostProcessorCircular Dependency
0 likes · 6 min read
How to Resolve Common Spring Boot Configuration Pitfalls and Circular Dependency Errors
Top Architect
Top Architect
Jun 25, 2024 · Backend Development

A Comprehensive Guide to Spring Boot Startup Sequence and Extension Points

This article explains the Spring Boot startup process, enumerates the key extension points and their execution order, demonstrates the sequence with practical code examples, and answers common questions about bean initialization, lifecycle callbacks, and the proper timing for opening RPC, MQ, and HTTP traffic.

BeanExtensionPointsJava
0 likes · 16 min read
A Comprehensive Guide to Spring Boot Startup Sequence and Extension Points
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
May 6, 2024 · Backend Development

How @Fallback Redefines Spring Bean Selection in 6.2

This article explains the new @Fallback annotation introduced in Spring 6.2, compares it with @Primary, shows code examples of bean configuration, and details the bean selection order changes before and after the 6.2 release.

BeanFallbackJava
0 likes · 5 min read
How @Fallback Redefines Spring Bean Selection in 6.2
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Mar 18, 2024 · Backend Development

Why Changing @Resource Field Names Breaks Spring Bean Injection

This article explains how Spring's @Resource injection resolves beans by name first and then by type, why mismatched field names or bean registration order cause NoSuchBeanDefinitionException, and how to correctly configure DAO and CommonDAO beans to avoid injection failures.

BeanJavaSpring
0 likes · 7 min read
Why Changing @Resource Field Names Breaks Spring Bean Injection
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Feb 1, 2024 · Backend Development

Common Pitfalls of @Autowired in Spring: Circular Dependencies and Bean Name Conflicts

This article explains the core concepts of Spring's @Autowired dependency injection, illustrates common mistakes such as unresolved circular dependencies and bean name collisions, and provides detailed solutions including constructor injection, qualifier usage, and bean priority annotations.

AutowiredBackendBean
0 likes · 11 min read
Common Pitfalls of @Autowired in Spring: Circular Dependencies and Bean Name Conflicts
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jan 8, 2024 · Backend Development

Why @Configuration Creates Proxies in Spring and Guarantees Singleton Beans

This article explains how Spring's @Configuration annotation triggers CGLIB proxy generation to manage @Bean methods, ensuring that internal calls return the same singleton instance, and contrasts this behavior with using @Component for configuration classes.

BeanCGLIBJava
0 likes · 8 min read
Why @Configuration Creates Proxies in Spring and Guarantees Singleton Beans
政采云技术
政采云技术
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.

BeanCircular DependencySpring
0 likes · 10 min read
Understanding Spring's Circular Dependency Resolution via Three-Level Caches
Top Architect
Top Architect
May 5, 2023 · Backend Development

How to Register Beans in the Spring Container: Five Common Methods

This article explains five ways to add a bean to the Spring IoC container—including @Configuration + @Bean, @Component + @ComponentScan, various @Import techniques, FactoryBean, and BeanDefinitionRegistryPostProcessor—provides complete code examples for each, and concludes with a summary and related promotional notes.

BeanJavaSpring
0 likes · 12 min read
How to Register Beans in the Spring Container: Five Common Methods
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Apr 28, 2023 · Backend Development

Mastering Spring @Bean: Declaration, Dependencies, Lifecycle & Scopes

This guide explains how to use Spring's @Bean annotation to declare beans, configure dependencies, control lifecycle callbacks, set custom scopes, assign names, aliases, and descriptions, providing Java code examples that parallel equivalent XML configurations.

BeanJavaLifecycle
0 likes · 9 min read
Mastering Spring @Bean: Declaration, Dependencies, Lifecycle & Scopes
Selected Java Interview Questions
Selected Java Interview Questions
Oct 9, 2022 · Backend Development

Various Ways to Register Beans in the Spring IoC Container

This article explains six common techniques for adding beans to the Spring IoC container, including @Configuration with @Bean, @Component with @ComponentScan, various @Import approaches, FactoryBean, and BeanDefinitionRegistryPostProcessor, providing code examples and usage details for each method.

BackendBeanJava
0 likes · 9 min read
Various Ways to Register Beans in the Spring IoC Container
Java Architect Essentials
Java Architect Essentials
Aug 17, 2022 · Backend Development

Pitfalls and Solutions for Converting Java Beans to Maps

Converting Java beans to maps often leads to type loss and incorrect property names due to JSON frameworks and BeanUtils behavior, and this article examines those pitfalls, demonstrates them with code examples, analyzes underlying Java introspection mechanisms, and presents a Dubbo‑based solution to reliably preserve types and property names.

BeanDubboJSON
0 likes · 12 min read
Pitfalls and Solutions for Converting Java Beans to Maps
Selected Java Interview Questions
Selected Java Interview Questions
Jul 31, 2022 · Backend Development

Understanding Spring IoC, Bean Instantiation, and Dependency Injection

This article explains the concepts of coupling, Inversion of Control, and Dependency Injection in the Spring framework, demonstrates various bean instantiation methods—including no‑arg constructors, static and instance factory methods—and provides a complete example of configuring and using Spring beans in a Java application.

BackendBeanIoC
0 likes · 9 min read
Understanding Spring IoC, Bean Instantiation, and Dependency Injection
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.

BeanBean OverridingJava
0 likes · 7 min read
Why @Configuration + @Bean Overrides @Component in Spring Boot and How Bean Definition Overriding Evolved
Top Architect
Top Architect
Jul 31, 2021 · Backend Development

Understanding Spring Bean Instantiation Process

This article explains how Spring's IoC container creates and manages beans, covering the container startup phase, bean definition loading, BeanFactoryPostProcessor and BeanPostProcessor extensions, object creation strategies, property injection, Aware interfaces, and bean lifecycle callbacks.

BackendBeanIoC
0 likes · 14 min read
Understanding Spring Bean Instantiation Process
Java Tech Enthusiast
Java Tech Enthusiast
Jun 18, 2021 · Backend Development

Spring Annotation-Based Bean Registration Guide

The guide explains how Spring’s annotation-driven configuration—using @Configuration and @Bean to define beans, @ComponentScan for automatic detection, and additional annotations such as @Scope, @Lazy, @Conditional, @Import and FactoryBean—replaces verbose XML, streamlining bean registration and lifecycle management.

AnnotationsBeanJava
0 likes · 10 min read
Spring Annotation-Based Bean Registration Guide
Selected Java Interview Questions
Selected Java Interview Questions
Apr 27, 2021 · Backend Development

Understanding the Spring Bean Instantiation Process

This article explains how the Spring IoC container prepares and creates Bean instances, detailing the two main phases—container startup and Bean instantiation—along with the roles of BeanDefinition, BeanFactoryPostProcessor, BeanWrapper, Aware interfaces, BeanPostProcessor, and custom initialization and destruction logic.

BackendBeanIoC
0 likes · 16 min read
Understanding the Spring Bean Instantiation Process
Top Architect
Top Architect
Dec 8, 2020 · Backend Development

Understanding Thread Safety of Spring Beans: Singleton vs Prototype Scope

This article explains why Spring beans are not inherently thread‑safe, compares the singleton and prototype scopes, shows how stateless beans can be safe, demonstrates the impact of static fields and injected beans, and provides practical code examples and recommendations for achieving thread safety in Spring applications.

BeanJavaPrototype
0 likes · 11 min read
Understanding Thread Safety of Spring Beans: Singleton vs Prototype Scope
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 7, 2020 · Backend Development

Understanding and Resolving Circular Dependencies in Spring Framework

This article explains the concept of circular dependencies in Spring, reviews related fundamentals, demonstrates how Spring's three-level cache resolves singleton circular references, discusses limitations with prototype and constructor injection, and provides code examples and detailed source analysis for developers.

AOPBeanCircular Dependency
0 likes · 22 min read
Understanding and Resolving Circular Dependencies in Spring Framework
Selected Java Interview Questions
Selected Java Interview Questions
Jul 27, 2020 · Backend Development

Understanding Spring Controller Scope and Thread Safety

The article explains why Spring MVC controllers are singleton by default, demonstrates the resulting thread‑unsafe behavior with example code, shows how applying @Scope("prototype") makes them prototype scoped, and provides best‑practice recommendations and a summary of Spring bean scopes.

BeanControllerPrototype
0 likes · 5 min read
Understanding Spring Controller Scope and Thread Safety