|
From: Hagen O. <hag...@hp...> - 2004-03-27 11:54:49
|
Hi all,
there is a glitch in AbstractApplicationContext.
AbstractBeanFactory.getMergedBeanDefinition() does a "instanceof
AbstractAutowireCapableBeanFactory"
AbstractApplicationContext does not extend that class, thus autowiring
is broken, when getParent() is used to initialize the inner
BeanFactory. The best solution is probably to clean the oo-design...
As a quick work around, I am using:
AbstractApplicationContext {
public BeanFactory getParentBeanFactory() {
BeanFactory theParent = getParent();
if (theParent != null
&& theParent instanceof ConfigurableApplicationContext)
{
theParent = ((ConfigurableApplicationContext) theParent)
.getBeanFactory();
}
return theParent;
}
}
and using that method only to initialize the inner BeanFactory.
Cheers
)-(agen
|