title: EJB annotation dosen't work for selectOneMenu JSF convertor
body: <p>I have a OneToOne relation for my Course Entity.In course create page I want to select relation field (Teacher) from a drop down list (selectOneMenu). as I know for this kind of operation you have to implement the Converter interface.but there is problem in my implemented class. my EJB annotation dose not work. so i cannot retrieve the convert value from my database. </p>
  
  <p>Teacher relation for showing the list of teacher in selectOneMenu.It works very well</p>
  
  <pre><code>@ManagedBean
  @ApplicationScoped
  public class TeacherRelation {
  
  @EJB
  private TeacherFacade teacherFacade;
  
  public List&lt;Teacher&gt; getAllTeachers() {
      List&lt;Teacher&gt; teacherList=new ArrayList&lt;Teacher&gt;();
      teacherList=teacherFacade.findAll();
      return teacherList;
  }
  
  }
  </code></pre>
  
  <p>the menu:</p>
  
  <pre><code>  &lt;h:selectOneMenu id="teacher" value="#{courseMB.course.teacher}" converter="teacherConvertor"&gt;
              &lt;f:selectItems value="#{teacherRelation.allTeachers}" id="items" var="teacherV" itemLabel="#{teacherV.lastName}" /&gt;
          &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>and finally important one.The implemented class</p>
  
  <pre><code>@RequestScoped
  @ManagedBean
  @FacesConverter("teacherConvertor")
  public class TeacherConvertor implements Converter,Serializable {
  
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  
  @EJB
  private static TeacherFacade teacherFacade;
  
  
  
  @Override
  public Object getAsObject(FacesContext ctx, UIComponent component, String value) {
  
  
      Long id=Long.valueOf(value);
      return teacherFacade.find(id);
  }
  
  @Override
  public String getAsString(FacesContext facesContext, UIComponent component, Object value) {
  
      return ((Teacher)value).getId().toString();
  }
  
  }
  </code></pre>
  
  <p>Servlet.service() for servlet Faces Servlet threw exception: java.lang.NullPointerException is the Exception when teacherFacade.find is executing.actually teacherFacade is null.What i have to do?</p>