Discussions

Web tier: servlets, JSP, Web frameworks: Injecting EJBs into JSF managed beans

  1. Injecting EJBs into JSF managed beans (1 messages)

    I have read that one can use the @EJB annotation inside a JSF managed bean to inject a reference to an EJB 3.0 session EJB, but when I try it I get a NullPointerException - meaning that the bean is not being injected. My annotation looks like this:

    @EJB private fully.qualified.business.interface.Type varName;

    I have a setter for the field as follows:

    public void setVarName(Type parm) {
      this.varName = parm;
    }

    Any ideas? Thanks in advance
  2. I have read that one can use the @EJB annotation inside a JSF managed bean to inject a reference to an EJB 3.0 session EJB, but when I try it I get a NullPointerException - meaning that the bean is not being injected. My annotation looks like this:@EJB private fully.qualified.business.interface.Type varName;I have a setter for the field as follows:public void setVarName(Type parm) {  this.varName = parm;}Any ideas? Thanks in advance

    You shoud really take a look at Seam. It would help you a lot.