Skip to content

Commit 3681d58

Browse files
committed
SpringBeanContainer leniently applies fallback on any BeansException
Issue: SPR-17430
1 parent 2146e13 commit 3681d58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-orm/src/main/java/org/springframework/orm/hibernate5/SpringBeanContainer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.hibernate.resource.beans.container.spi.ContainedBean;
2626
import org.hibernate.resource.beans.spi.BeanInstanceProducer;
2727

28-
import org.springframework.beans.factory.BeanCreationException;
28+
import org.springframework.beans.BeansException;
2929
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
3030
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
3131
import org.springframework.lang.Nullable;
@@ -154,7 +154,7 @@ private SpringContainedBean<?> createBean(
154154
return new SpringContainedBean<>(this.beanFactory.getBean(beanType));
155155
}
156156
}
157-
catch (BeanCreationException ex) {
157+
catch (BeansException ex) {
158158
if (logger.isDebugEnabled()) {
159159
logger.debug("Falling back to Hibernate's default producer after bean creation failure for " +
160160
beanType + ": " + ex);
@@ -177,7 +177,7 @@ private SpringContainedBean<?> createBean(
177177
return new SpringContainedBean<>(this.beanFactory.getBean(name, beanType));
178178
}
179179
}
180-
catch (BeanCreationException ex) {
180+
catch (BeansException ex) {
181181
if (logger.isDebugEnabled()) {
182182
logger.debug("Falling back to Hibernate's default producer after bean creation failure for " +
183183
beanType + ": " + ex);

0 commit comments

Comments
 (0)