Skip to content

Commit 04f3181

Browse files
committed
Avoid getTypeForFactoryBean warn logging for lazy-init beans
Issue: SPR-13833
1 parent 9bffb9e commit 04f3181

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,9 +1475,14 @@ protected Class<?> getTypeForFactoryBean(String beanName, RootBeanDefinition mbd
14751475
logger.debug("Bean currently in creation on FactoryBean type check: " + ex);
14761476
}
14771477
}
1478+
else if (mbd.isLazyInit()) {
1479+
if (logger.isDebugEnabled()) {
1480+
logger.debug("Bean creation exception on lazy FactoryBean type check: " + ex);
1481+
}
1482+
}
14781483
else {
14791484
if (logger.isWarnEnabled()) {
1480-
logger.warn("Bean creation exception on FactoryBean type check: " + ex);
1485+
logger.warn("Bean creation exception on non-lazy FactoryBean type check: " + ex);
14811486
}
14821487
}
14831488
onSuppressedException(ex);

0 commit comments

Comments
 (0)