title: Ambiguous dependencies for type
body: <p>I am getting this exception when I try deploying my application to Glassfish Server:</p>
  
  <blockquote>
    <p>org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous
    dependencies for type [FileReferenceDao] with qualifiers [@Default] at
    injection point [[BackedAnnotatedField] @Inject
    com.tugay.fup.web.MyUploadedFilesBean.fileReferenceDao]. Possible
    dependencies [[Session bean [class
    com.tugay.fup.core.dao.FileReferenceDao with qualifiers [@Any
    @Default]; local interfaces are [FileReferenceDao], Session bean
    [class com.tugay.fup.core.dao.FileReferenceDao with qualifiers [@Any
    @Default]; local interfaces are [FileReferenceDao]]]</p>
  </blockquote>
  
  <p>The interesting part is </p>
  
  <blockquote>
    <p>Possible dependencies [[Session bean [class
    com.tugay.fup.core.dao.FileReferenceDao with qualifiers [@Any
    @Default]; local interfaces are [FileReferenceDao], Session bean
    [class com.tugay.fup.core.dao.FileReferenceDao with qualifiers [@Any
    @Default]; local interfaces are [FileReferenceDao]]]</p>
  </blockquote>
  
  <p>What is going on in here? </p>
  
  <p>I only have one FileReferenceDao, which has no Interface or anything else. It does not extend any other class. And this is how I use it:</p>
  
  <pre><code>import javax.enterprise.context.RequestScoped;
  import javax.inject.Inject;
  import javax.inject.Named;
  
  @Named
  @RequestScoped
  public class MyUploadedFilesBean {
  
      @Inject
      FileReferenceDao fileReferenceDao;
  </code></pre>
  
  <p>Everything was working fine until 15 minutes ago.</p>
  
  <p>I tried mixing JSF Managed beans with CDI beans, it did not work, I rolled - back. Now I am getting this exception.</p>
  
  <pre><code>@Stateless public class FileReferenceDao {
  
      @PersistenceContext(unitName = "Persistence")
      EntityManager em;
  </code></pre>