Previously, we only looked at the OBJECT_TYPE_ATTRIBUTE on a FactoryBean's bean definition; however this does not work for situations where the information is provided by the definition's target type rather than the attribute. Rather than manually considering the target type in addition to the existing consideration of the attribute, we now ask the BeanFactory for the type that will be produced by the FactoryBean instead. See https://github.com/spring-projects/spring-boot/issues/40234 Closes gh-33811 Co-authored-by: Andy Wilkinson <andy.wilkinson@broadcom.com>