You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.IllegalArgumentException: Object of class [null] must be an instance of interface org.springframework.beans.factory.config.ConfigurableBeanFactory
at org.springframework.util.Assert.isInstanceOf(Assert.java:339)
at org.springframework.util.Assert.isInstanceOf(Assert.java:319)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.getBeanFactory(ConfigurationClassEnhancer.java:414)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:289)
at de.olivergierke.samples.spring.ConfigClassExtensionTest$ChildConfig$$EnhancerByCGLIB$$769c39d2.myComponent(<generated>)
This seems to be caused by the fix for #14941. Previously a BeanFactory instance had been available at the point in time when the autowiring happens. As of the change, the BeanFactory will be injected through an BeanFactoryAware call which by Spring's lifecycle happens after property injection. Thus the required BeanFactory is null when the injection shall happen and thus it fails.
Uh oh!
There was an error while loading. Please reload this page.
Oliver Drotbohm opened SPR-10668 and commented
Assume you have a configuration class autowiring a component a subclass of this config class might declare:
This fails with a rather ambiguous:
This seems to be caused by the fix for #14941. Previously a
BeanFactory
instance had been available at the point in time when the autowiring happens. As of the change, theBeanFactory
will be injected through anBeanFactoryAware
call which by Spring's lifecycle happens after property injection. Thus the requiredBeanFactory
isnull
when the injection shall happen and thus it fails.I have an executable sample for this at http://github.com/olivergierke/spring-samples. Steps to reproduce:
mvn clean test
-> workspom.xml
to 4.0.0.BUILD-SNAPSHOTmvn clean test
-> failsIssue Links:
Referenced from: commits a403e8f
The text was updated successfully, but these errors were encountered: