I debug and see that the parent's injections are not complete at all. The DataSource field that should be injected in ParentDaoImpl is null. But the injection definitions seem ok in application context so where's the problem? I call the parent's bean separately and it works!
Spring does not trace the whole object hierarchy from the child class to the first ancestor which means that it does not do the necessary dependency injections to the parent chain. Thus my DataSource field in the ParentDaoImpl is not injected.
If you extend some class in your java code and you want the child class to work properly with parents' functionality you have to tell Spring explicitly that your child class has a parent.
So your application context should go from
to
No comments:
Post a Comment