I am injecting a spring-managed bean into an abstract class and it seems that it doesn't work. Here is an explanation of what I do, if it is not enough, I can edit the post and add some code:
- implement the java code - 1 abstract class, 2 classes that inherit from it and the bean to be injected and used in the abstract class and thus by the subclasses.
- define the bean in the spring config.
- define the abstract class and 2 subclasses in the spring config.
- define the first bean as a property of the abstract class bean.
result - it's not working.
Then I tried to move the injected bean from the abstract class into the two subclasses. Now it works.
So, did I do something wrong, or is it theoretically impossible to inject a bean into an abstract class with spring 3 and Java EE 5?