这似乎不起作用:
@Inject
private MyBBean<OtherBBean> myBean;
它应该有效还是尝试这样做是错误的?我收到此错误:
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [MyBBean<OtherBBean>] with qualifiers [@Default] at injection point [[field] @Inject private com.my.project.beans.jsf.BreakBBean.myBBean]
编辑:添加更多信息:
@Named(value="org")
@SessionScoped
public class OrgBBean extends MainViewBase<Org> implements Serializable {
private static final long serialVersionUID = 1L;
@Inject
private OtherBBean otherBBean;
}
@Named
@Dependent
public class OtherBBean extends OrgTabMemberBBean<Other> implements Serializable {
private static final long serialVersionUID = 1L;
@Inject
private MyBBean<OtherBBean> myBBean;
}
@Named
@Dependent
public class MyBBean <O extends EditableBase<? extends BaseEntity>> extends EditableTabListBBean<My, O> implements Serializable {
private static final long serialVersionUID = 1L;
}