title: WELD-001408 Unsatisfied dependencies when injecting EntityManager
body: <p>I have <code>@Stateless</code> bean which implements two interfaces (remote and local). I have also added <code>@LocalBean</code> anotation for accessing bean with a no-interface view.</p>
  
  <pre><code>@Stateless
  @LocalBean
  public class WeatherDataBean implements WeatherDataBeanRemote, WeatherDataBeanLocal {
      @Inject
      private EntityManager entityManager;
  
      public WeatherDataBean () {
  
      }
      // ....attributes, getter &amp; setter methods ....
  }
  </code></pre>
  
  <p>I use <code>@Inject</code> for this reason taken <a href="http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/guide/GreeterQuickstart/#GreeterQuickstart-" rel="noreferrer">from this example of JBoss AS7 quickstart</a>:</p>
  
  <blockquote>
    <p>We use the "resource producer" pattern, from CDI, to "alias" the old fashioned @PersistenceContext injection of the entity manager to a CDI style injection. This allows us to use a consistent injection style (@Inject) throughout the application. </p>
  </blockquote>
  
  <p>Now previously I have used:</p>
  
  <pre><code>@PersistenceContext(unitName="WeatherStationJPA")
  private EntityManager entityManager;
  </code></pre>
  
  <p>In EJB and it works without any problem. But with <code>@Inject</code> annotation I get this error:</p>
  
  <blockquote>
    <p>WELD-001408 Unsatisfied dependencies for type [EntityManager] with
    qualifiers [@Default] at injection point [[field] @Inject private
    ejb.WeatherDataBean.entityManager]</p>
  </blockquote>
  
  <p>Here is how I have class Resources defined:</p>
  
  <pre><code>public class Resources {
       @SuppressWarnings("unused")
       @PersistenceContext(unitName="WeatherStationJPA")
       @Produces
       private EntityManager entityManager;
  
       @Produces
       FacesContext getFacesContext() {
           return FacesContext.getCurrentInstance();
       }
  }
  </code></pre>
  
  <p>Why Is that I get this error if I try to inject entity manager?</p>
  
  <p><strong>EDIT:</strong>
  On request from @LightGuard I am adding packages that I am using to reference annotations:</p>
  
  <ol>
  <li><p><strong>WeatherDataBean</strong> has:</p>
  
  <pre><code>import javax.ejb.LocalBean;
  import javax.ejb.Stateless;
  import javax.inject.Inject;
  </code></pre></li>
  <li><p><strong>Resources</strong> has:</p>
  
  <pre><code>import javax.enterprise.inject.Produces;
  import javax.faces.context.FacesContext;
  import javax.inject.Singleton;
  import javax.persistence.EntityManager;
  import javax.persistence.PersistenceContext;
  </code></pre></li>
  </ol>