Example usage for org.springframework.beans.factory BeanCreationException getRelatedCauses

List of usage examples for org.springframework.beans.factory BeanCreationException getRelatedCauses

Introduction

In this page you can find the example usage for org.springframework.beans.factory BeanCreationException getRelatedCauses.

Prototype

@Nullable
public Throwable[] getRelatedCauses() 

Source Link

Document

Return the related causes, if any.

Usage

From source file:org.springframework.beans.factory.xml.XmlBeanFactoryTests.java

@Test
public void testRelatedCausesFromConstructorResolution() {
    DefaultListableBeanFactory xbf = new DefaultListableBeanFactory();
    new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT);

    try {//ww  w. j ava  2  s  .  c om
        xbf.getBean("rod2Accessor");
    } catch (BeanCreationException ex) {
        assertTrue(ex.toString().indexOf("touchy") != -1);
        ex.printStackTrace();
        assertNull(ex.getRelatedCauses());
    }
}