FactoryBean type check logs currently-in-creation exception at debug level

Issue: SPR-12900
This commit is contained in:
Juergen Hoeller
2015-04-16 18:16:03 +02:00
parent aa49949d7a
commit 65ba72f1fc
3 changed files with 17 additions and 5 deletions

View File

@@ -1451,9 +1451,15 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return getTypeForFactoryBean(factoryBean);
}
catch (BeanCreationException ex) {
// Can only happen when getting a FactoryBean.
if (logger.isWarnEnabled()) {
logger.warn("Bean creation exception on FactoryBean type check: " + ex);
if (ex instanceof BeanCurrentlyInCreationException) {
if (logger.isDebugEnabled()) {
logger.debug("Bean currently in creation on FactoryBean type check: " + ex);
}
}
else {
if (logger.isWarnEnabled()) {
logger.warn("Bean creation exception on FactoryBean type check: " + ex);
}
}
onSuppressedException(ex);
return null;