I have testBeanId which refers testList
<bean id="testBeanId" class="com.test">
<property name="testList" ref="testList"/>
</bean>
Now testList is defined under two different xml files which can be under same/separate jar files
XML1
<util:list id="testList">
<value>1</value>
<value>2</value>
</util:list>
XML2
<util:list id="testList">
<value>3</value>
</util:list>
My question is which list will be injected under testBeanId. Will it be 3 or 1,2 ?
As per my understanding from skaffman answer at Spring's overriding bean , we can have two bean with same id provided its in two different xml files but will never be sure which one will be injected. Hence error prone
But lboix answer says bean from second file will override first one. But i am not sure which one will be second file as its dependent on classloaded is n't it ?