title: Injected EJB Reference Lost in ViewScoped JSF Bean
body: <p>I've seen quite a bit of discussion on the injection of EJBs into ViewScoped JSF-managed beans.  It seems acceptable practice to do so.  </p>
  
  <p>I'm attempting to change one of the beans in my application from RequestScoped to ViewScoped to add some additional needed functionality.</p>
  
  <p>I've modified the EJB classes to ensure that everything is serializable.  When my JSF bean is created, the EJBs are initially accessible.  However, when a user action fires a method in the bean that tries to invoke an EJB method, a NullPointerException is thrown.</p>
  
  <p>As soon as I switch the bean from ViewScoped back to RequestScoped, everything works fine.</p>
  
  <p>Could this be a fault in the implementation of JSF being used?  This application is using MyFaces 2.1.12 and runs on Websphere 7.0.</p>
  
  <p>Thanks.</p>