Tagged articles

bean-injection

5 articles · Page 1 of 1
Sanyou's Java Diary
Sanyou's Java Diary
Jan 30, 2023 · Backend Development

Mastering Spring Bean Injection: 5 Ways to Register Beans in the Container

This article comprehensively reviews the various techniques for injecting beans into the Spring container—including XML and properties configuration files, annotation-based declarations, manual BeanDefinition registration, direct singleton registration, and FactoryBean usage—providing code examples, underlying principles, and practical guidance for each method.

Backend DevelopmentDependency InjectionSpring
0 likes · 18 min read
Mastering Spring Bean Injection: 5 Ways to Register Beans in the Container
Shepherd Advanced Notes
Shepherd Advanced Notes
May 31, 2022 · Backend Development

Debugging Spring Boot + Nacos Config Center: Why @NacosConfigurationProperties Fails to Load Local Bean Properties

The article investigates why a Spring Boot application using Nacos as a configuration center does not inject bean properties defined locally when the Nacos console lacks those entries, by walking through the integration steps and analyzing the relevant source code.

Configuration CenterNacosConfigurationPropertiesSpring Boot
0 likes · 11 min read
Debugging Spring Boot + Nacos Config Center: Why @NacosConfigurationProperties Fails to Load Local Bean Properties
Java Architecture Diary
Java Architecture Diary
Jun 23, 2020 · Backend Development

Fixing @RefreshScope Conflict with @ConditionalOnSingleCandidate in Spring Boot

In Spring Cloud projects, adding @RefreshScope to a custom RabbitMQ ConnectionFactory can clash with @ConditionalOnSingleCandidate, preventing RabbitTemplate from being auto‑wired; this article explains the root cause, demonstrates how to diagnose the issue, and provides a solution to avoid such bean conflicts.

@RefreshScopeConditionalOnSingleCandidateRabbitMQ
0 likes · 5 min read
Fixing @RefreshScope Conflict with @ConditionalOnSingleCandidate in Spring Boot
Meituan Technology Team
Meituan Technology Team
Oct 1, 2016 · Backend Development

Debugging Spring MVC @Service Bean Injection Issues with JMap and JHat

The article explains how a Spring MVC service bean was duplicated across root and child WebApplicationContexts, causing a null‑injected instance that triggered a NullPointerException, and shows how JMap and JHat were used to locate the two beans and resolve the issue by adjusting component‑scan filters or removing the @Service annotation.

Javabean-injectiondebugging
0 likes · 14 min read
Debugging Spring MVC @Service Bean Injection Issues with JMap and JHat