Description
Tomasz Bech opened SPR-7254 and commented
Under some conditions, spring context is wrongly created.
Problem appears when:
- there are beans/code which requires eager creation of the beans (autowiring by type or getBeansByType());
- there are instances of FactoryBean-s;
- some of the beans during eager creation cannot be instanciated;
- aliases are used;
The original problem happened with cxf library and thousands of objects in spring context. Out of that, hopefully, I was able to build the testcase. It is attached - as separate project (maven).
As it is, it fails with NullPointerException - this means that one of the BeanK has 'wrongly created object of type BeanW' injected.
When you get rid of beanWAlias from the test.xml - test passes.
Look on BeanD - at first time it throws exception during construction - it leads to destorying of eagerly created singletons - but the destruction is not correct/full - beanK remains in the context. It is because 'alias' is used.
Affects: 2.5.6
Attachments:
- springTest.zip (9.56 kB)
Referenced from: commits de866a0