When a JSF managed bean extends an abstract Controller, I get Unsatisfied dependencies exception. I have methods in the AbstractController which I would like to override in the PoliceCaseList Bean. However, I get the exception below: I tried reading here and here , but my situation seems different.
exception
javax.servlet.ServletException: WELD-001408 Unsatisfied dependencies for type [AbstractFacade] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject private ijmiscrudgen.backing.AbstractController.ejbFacade]
root cause
org.jboss.weld.exceptions.IllegalArgumentException: WELD-001408 Unsatisfied dependencies for type [AbstractFacade] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject private ijmiscrudgen.backing.AbstractController.ejbFacade]
@ManagedBean
@ViewScoped
public class PoliceCaseList extends AbstractController<TblCase>{
@Inject
private TblCaseFacade caseFacade;
private TblCasePerson selectedPerson;
private TblCase selected;
@ManagedProperty(value = "#{loginController}")
private LoginController loginController;
/**
* Creates a new instance of PoliceCaseList
*/
public PoliceCaseList() {
}
Here is the Abstract Controller. This Controller has methods which I always want to override. Beans with annotation @Named extend this controller and there are no complaints but the ones annotated with @ManagedBean get the exception above. How can I extend this AbstractController in my JSF Managed Beans without Unsatisfied dependency complaints?
public abstract class AbstractController<T> {
@Inject
private AbstractFacade<T> ejbFacade;
private Class<T> itemClass;
private T selected;
private Collection<T> items;
private boolean trueOrFalse;
private static int idOfSubmittedRecord;
private enum PersistAction {
CREATE,
DELETE,
UPDATE
}
public AbstractController() {
}