Spring throws the error: Bean definition is abstract

前端 未结 3 1513
醉酒成梦
醉酒成梦 2021-01-19 14:42

I need some help with next topic.

I have a hierarchy of beans, just like that:



        
3条回答
  •  花落未央
    2021-01-19 15:23

    First of all abstract bean has nothing to do with the abstract class they don't even need to be mapped to a class.They are used to group the common properties shared by another beans.But you can not use an abstract bean as a ref to wire a property in another bean. If your bean myPackage.Another has a reference of type myPackage.Father and your child beans are assignable (either extends of implements) to myPackage.Father then you can wire either childA or childB in your myPackage.Another bean like this

      
                
        
    

提交回复
热议问题