advancedSpring Internals — Bean Lifecycle & Proxies

What happens when two auto-configurations define the same bean with conflicting conditions?

Spring Boot evaluates auto-configuration classes in a defined order (via @AutoConfigureBefore/@AutoConfigureAfter and @ConditionalOnMissingBean); the first one whose conditions pass typically wins, and later ones back off. Running with --debug shows the exact Conditions Evaluation Report explaining which configuration was applied and why.

This is a Pro question

Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.

What happens when two auto-configurations define the same bean with conflicting conditions?

Next Step

Continue to Why can overriding an auto-configured bean unintentionally disable metrics, tracing, or health checks?← Back to all Spring Boot & Microservices questions