Hi Mark,
Well, that's what i thought.. but its not what i see
My CustomerController bean is marked a BeanFactoryAware, and the Home beanfactory is correctly injected into it, so i know its getting loaded from the beanfactory and not by fw/1 manually instantiating it. I've also double checked this by setting a property on it via the bean def.
But if i execute this in my controller
dump(var=variables.beanFactory.containsbean("CustomerService"), label="contains bean CustomerService?");
dump(var=variables.beanFactory.hasParentBeanFactory(), label="has parent bean factory?");
dump(var=variables.beanFactory.getParentBeanFactory().containsbean("CustomerService"), label="parent contains bean CustomerService?");
abort;
I get
|
contains bean CustomerService? |
|
|
parent contains bean CustomerService? |
|
The problem is that when the child bean factory is created there is no parent set, so the BeanDefinistionRegistry is init'd with no reference to the parent. This means that you can never get inside
this if block.
A work around seems to be to call refresh() after setParentBeanFactory(), but its not obvious that you need to do that, so maybe this should be done for you inside setParentBeanFactory() ?
Chris