When I am inside the constructor of a managed and trying to reach out to other methods from other beans, I got java.lang.NullPointerException
. Is there some kind of specification that not allow managed bean to do that?
@ManagedProperty(value="#{document}")
private DisplayListController document;
@EJB
DocumentSBean sBean;
public NewUserController() {
document.list();
}
Above I just do regular bean injection, nothing fancy. document
is a SessionScoped
managed bean that has method list()
which just return a String
. NewUserController
is a RequestScoped
managed bean.