ClassPathXmlApplicationContext parent = new ClassPathXmlApplicationContext("childcontainer/parent-context.xml");
Parent parentBean = (Parent) parent.getBean("parent");
// this fails because there is no child context
try {
parentBean.tryGetChild();
fail();
}
catch (NoSuchBeanDefinitionException e) {
}