Protect against 'has not been resolved to a Class'
Update AbstractAutowireCapableBeanFactory.getTypeForFactoryBean to check AbstractBeanDefinition.hasBeanClass() before calling getBeanClass(). The protects against a 'Bean class name [<name>] has not been resolved into an actual Class' IllegalStateException. Issue: SPR-10304
This commit is contained in:
@@ -683,7 +683,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
if (factoryBeanName != null && factoryMethodName != null) {
|
||||
// Try to obtain the FactoryBean's object type without instantiating it at all.
|
||||
BeanDefinition fbDef = getBeanDefinition(factoryBeanName);
|
||||
if (fbDef instanceof AbstractBeanDefinition) {
|
||||
if (fbDef instanceof AbstractBeanDefinition && ((AbstractBeanDefinition) fbDef).hasBeanClass()) {
|
||||
Class<?> fbClass = ((AbstractBeanDefinition) fbDef).getBeanClass();
|
||||
if (ClassUtils.isCglibProxyClass(fbClass)) {
|
||||
// CGLIB subclass methods hide generic parameters. look at the superclass.
|
||||
|
||||
Reference in New Issue
Block a user