getTypeForFactoryBean suppresses instantiation failures for non-singleton FactoryBeans

Issue: SPR-12786
(cherry picked from commit 9b25d6a)
This commit is contained in:
Juergen Hoeller
2015-03-06 18:10:28 +01:00
parent f2691901bb
commit f01a0303f1
2 changed files with 43 additions and 16 deletions
@@ -897,6 +897,14 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
instance = bw.getWrappedInstance();
}
}
catch (BeanCreationException ex) {
// Can only happen when getting a FactoryBean.
if (logger.isDebugEnabled()) {
logger.debug("Bean creation exception on non-singleton FactoryBean type check: " + ex);
}
onSuppressedException(ex);
return null;
}
finally {
// Finished partial creation of this bean.
afterPrototypeCreation(beanName);