Announcement Announcement Module
Collapse
No announcement yet.
Uninitialized dependency assigned to dependant Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Uninitialized dependency assigned to dependant

    The following app context is invoking "init" on BeanTwo before it is being run on BeanOne.
    Code:
    <bean id="BeanOne" class="com.test.BeanOneClass" init-method="init"/>
    <bean id="BeanTwo" class="com.test.BeanTwoClass" init-method="init">
        <property name="beanOne" ref="BeanOne"/>
    </bean>
    It seems to me that if a bean has an "init-method" then I'm trying to indicate that the bean is not actually "ready" until it has been invoked. I can see this causing problems in the case of circular dependencies, but this is a very clear cut case.

    Is there anyplace I can go (I've looked) to find documentation on the exact order beans are initialized? (IE. Constructed, Properties Set, Autowired, afterPropertiesSet, init-method, ... etc.)


    Edit:
    Currently using - org.springframework:org.springframework.spring-library:3.0.4.RELEASE

  • #2
    I found a mistake in the way the configuration was put together that was causing them to initialize wrong. Basically it wasn't the init-method of BeanTwo that was causing BeanOne to throw exceptions, but rather a superclass of BeanOne which had an "afterPropertiesSet" method.

    None the less, if anybody has access to good documentation on the container load order I would still appreciate it.

    Thanks!
    Last edited by dew_the_fifth; Apr 1st, 2011, 12:55 PM.

    Comment

    Working...
    X