1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Ticket #91 (accepted defect)

Opened 4 months ago

Last modified 3 months ago

factory-bean not looked for in parent factory

Reported by: d1rtym0nk3y Owned by: markmandel
Priority: major Milestone: Alpha2
Component: Beans Version: 2.0
Keywords: factory, bean, parent Cc:

Description

I have an application factory set as parent for an internal factory for modelglue. in the modelglue config bean i'm referencing a factory bean in the parent factory like this..

<bean id="modelglue.modelGlueConfiguration" class="ModelGlue.gesture.configuration.ModelGlueConfiguration">
  <property name="reload">
    <bean factory-bean="AppConfig" factory-method="getReloadEveryRequest" />
  </property>
<!-- all the other usual properties here -->
</bean>

This generates the error "The Bean Definition 'AppConfig?' does not exist in this factory". True, but it does exist in the parent factory and this worked in CS1.2

If I import the xml file containing the AppConfig? bean then this works fine

Change History

Changed 4 months ago by markmandel

  • owner set to markmandel
  • status changed from new to accepted
  • version changed from BER to 2.0

Ah yep - I see it.
https://github.com/markmandel/coldspring/blob/develop/coldspring/beans/support/CFCBeanDefinition.cfc#L272

Should be a call to 'getBeanDefinitionIncludingAncestor' on the BeanDefinitionRegistry?.

Will write up a unit test to confirm.

Changed 3 months ago by d1rtym0nk3y

Mark,

I've patched this in my fork but it doesn't seem to have fixed the problem. Its affecting factory beans and autowiring of beans from a parent factory in a child.

As a work around i'm <import>ing the beans into the child factory but this isn't an ideal solution

https://github.com/d1rtym0nk3y/coldspring/commit/5909d74c26272ce454720632e7039a65031089d5

Changed 3 months ago by markmandel

Hey - I haven't forgotten about you - just been crazy busy with stuff.

I'll be sure to jump on this asap.

Note: See TracTickets for help on using tickets.