Overview
In DefaultListableBeanFactory::determinePrimaryCandidate(...), it is possible for multiple @Primary beans to be resolved.
If the calling code ignores the NoUniqueBeanDefinitionException (I'm unsure if I can make a simple reproduction of this easily), the oversight can be hidden to the developer.
Could a log mirroring the exception message be included?
I'm unsure what Log Level would be best, but it would be useful.
Spring Framework 6.2.11
Before writing this, I checked the debugging experience by setting logging.level.org.springframework.beans: trace and setting a break point in the @Bean declaration.
That was not enough information to see why a specific bean was resolving, hence the request here.
Overview
In
DefaultListableBeanFactory::determinePrimaryCandidate(...), it is possible for multiple@Primarybeans to be resolved.If the calling code ignores the
NoUniqueBeanDefinitionException(I'm unsure if I can make a simple reproduction of this easily), the oversight can be hidden to the developer.Could a log mirroring the exception message be included?
I'm unsure what Log Level would be best, but it would be useful.
Spring Framework 6.2.11
Before writing this, I checked the debugging experience by setting
logging.level.org.springframework.beans: traceand setting a break point in the@Beandeclaration.That was not enough information to see why a specific bean was resolving, hence the request here.