0
這似乎並不工作:我可以@注入泛型類型嗎?
@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;
}
我已經發布了代碼。 – Pierre