From 3681d58e98797f67592f930fa3b11229a7876a18 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 25 Oct 2018 18:06:06 +0200 Subject: [PATCH] SpringBeanContainer leniently applies fallback on any BeansException Issue: SPR-17430 --- .../springframework/orm/hibernate5/SpringBeanContainer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate5/SpringBeanContainer.java b/spring-orm/src/main/java/org/springframework/orm/hibernate5/SpringBeanContainer.java index 32f6dceaf0..9280d38230 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate5/SpringBeanContainer.java +++ b/spring-orm/src/main/java/org/springframework/orm/hibernate5/SpringBeanContainer.java @@ -25,7 +25,7 @@ import org.hibernate.resource.beans.container.spi.BeanContainer; import org.hibernate.resource.beans.container.spi.ContainedBean; import org.hibernate.resource.beans.spi.BeanInstanceProducer; -import org.springframework.beans.factory.BeanCreationException; +import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.lang.Nullable; @@ -154,7 +154,7 @@ public final class SpringBeanContainer implements BeanContainer { return new SpringContainedBean<>(this.beanFactory.getBean(beanType)); } } - catch (BeanCreationException ex) { + catch (BeansException ex) { if (logger.isDebugEnabled()) { logger.debug("Falling back to Hibernate's default producer after bean creation failure for " + beanType + ": " + ex); @@ -177,7 +177,7 @@ public final class SpringBeanContainer implements BeanContainer { return new SpringContainedBean<>(this.beanFactory.getBean(name, beanType)); } } - catch (BeanCreationException ex) { + catch (BeansException ex) { if (logger.isDebugEnabled()) { logger.debug("Falling back to Hibernate's default producer after bean creation failure for " + beanType + ": " + ex); -- GitLab