I have two abstract classes
class abstract A {
//some methods .
}
class abstract B extends A {
private C c ;
//other methods
}
Spring config file :
<bean id="b" class="B" abstract="true">
<property name="c" ref="C" /> //I have reference for C else where
</bean>
When I run the program , the class c is not getting injected . It is coming as null . Am i missing something ?
abstract=truemeans that the bean specification is a ‘template’ for other bean declarations to extend, it does not mean the class is abstract. I suspect bean with idbis not being created since it is a template/abstract definition. Removeabstract=trueand makeBa concrete type and it should work.Documentation here: http://static.springsource.org/spring/docs/3.0.x/reference/beans.html#beans-child-bean-definitions