Skip to content

Commit 0ac04a7

Browse files
committed
Include original exception message in dependency initialization exception
Closes gh-32470
1 parent 370a4ee commit 0ac04a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ else if (requiredType != null) {
322322
// requested (indicated by required type), not for depends-on cascades.
323323
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
324324
"Failed to initialize dependency '" + ex.getBeanName() + "' of " +
325-
requiredType.getSimpleName() + " bean '" + beanName + "'", ex);
325+
requiredType.getSimpleName() + " bean '" + beanName + "': " +
326+
ex.getMessage(), ex);
326327
}
327328
throw ex;
328329
}

0 commit comments

Comments
 (0)