It looks like the dependency is not beeing injected, is there anything wrong with my code?
Page
<p:dataTable styleClass="centralizado" id="cdt" var="c" value="#{indexBean.getCampanhas()}">
IndexBean
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
@ManagedBean
@ViewScoped
public class IndexBean {
@Inject
private GerenciaContas contas;
@Inject
private GerenciaCampanhas campanhas;
@Inject
private Conversor conv;
public List<Campaign> getCampanhas() throws Exception {
return campanhas.getTodasCampanhas();
}
public GerenciaContas getContas() {
return contas;
}
public Conversor getConversor() {
return conv;
}
}
One of the classes I use:
public class GerenciaCampanhas
{
public List<Campaign> getTodasCampanhas() throws Exception {
//ordinary code
}
}
Am I missing any Annotation in my Conversor class ? I am getting a NullPointerException because "GerenciaCampanhas campanhas" is null then calling the method getCampanhas() in my indexBean Thanks