In DefaultListableBeanFactory::determinePrimaryCandidate, it is possible for multiple @Primary
Beans to be resolved. If the calling code ignores the Bean Exception (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 about the debugging experience when doing 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.