Dave Syer opened SPR-16961 and commented

When a @Bean method returns null it becomes non-autowirable, but the exception message only says that there are "no beans" of the required type. In fact there was one, but it was null, and that would be more useful information.


Affects: 5.0.7

Reference URL: https://github.com/spring-projects/spring-boot/issues/13531

Issue Links: - #21498 Odd behaviour with null bean instance when an alternative autowire candidate is available

Comment From: snicoll

This injects null now.