title: Spring throws the error: Bean definition is abstract
body: <p>I need some help with next topic.</p>
  
  <p>I have a hierarchy of beans, just like that:</p>
  
  <pre><code>&lt;bean id="father" class="myPackage.Father" abstract="true"/&gt;  
  
  &lt;bean id="childA" class="myPackage.ChildA" parent="father"&gt;    
          &lt;property name="atrib1" value="hello"&gt;&lt;/property&gt;  
  &lt;/bean&gt;  
  
  &lt;bean id="childB" class="myPackage.ChildB" parent="father"&gt;  
          &lt;property name="atrib2" value="bye"&gt;&lt;/property&gt;  
          &lt;property name="atrib3" value="other"&gt;&lt;/property&gt;  
  &lt;/bean&gt;  
  </code></pre>
  
  <p>I need to create another bean which contains a reference to the abstract class. Then at run-time, I will need to be able to initialize a variable of TYPE "myPackage.Father" and instantiate it with any of the children classes (the polymorphism mechanism). I mean something like that:</p>
  
  <pre><code>&lt;bean id="reference" class="myPackage.Another"&gt; 
          &lt;property name="atrib4" ref="father"&gt;&lt;/property&gt;
  &lt;/bean&gt;  
  </code></pre>
  
  <p>Note that reference (an instance of myPackage.Another) is not a subclass of myPackage.Father. But with these lines Spring throws the next error: </p>
  
  <pre><code>Bean definition is abstract
  </code></pre>
  
  <p>How could I deal with it?</p>
  
  <p>I appreciate any help, thanks in advance!</p>