BeanDefinitionValidationException when beans are null (NullBean) and initMethod is set [SPR-16063] #20612
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Loabe Me opened SPR-16063 and commented
After upgrading to Spring 5.0.0 the following exception occurs during application runtime:
I tracked it down to the AbstractAutowireCapableBeanFactory.invokeCustomInitMethod where the bean object is correctly typed as NullBean.class. But nonetheless there is a BeanDefinitionValidationException thrown because the initMethod is null. Is this an expected change in behavior from 4.x to 5.x? For our situation its a breaking change because there is a 3rd party library initialized that can produce null beans. If that change was expected, whats the correct way to do handle that situation with 5.x?
Affects: 5.0 GA
Issue Links:
@Bean
return nullReferenced from: commits 91a8993
The text was updated successfully, but these errors were encountered: