Reputation: 19011
According to EJB3 DI documentation it is possible to inject fields and setters. But how to inject a bean constructor ?
Upvotes: 2
Views: 998
Reputation: 33956
The EJB specification does not support constructor injection. The EJB programming model only uses the no-arg constructor, and can then perform field or setter method injection after the instance has been constructed.
That said, EJB 3.1 is part of EE 6, which includes CDI. If your EJB module is a CDI BDA (bean deployment archive) because it includes beans.xml, then you can use CDI constructor injection.
Upvotes: 3