title: Bean name is ambiguous matches same bean twice
body: <p>I'm trying to use spring-data-jpa and spring-data-mongodb. On deploy, several of my repositories deploy, until one (a random one each time) fails to deploy with an error of</p>
  
  <pre><code>Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414:   Bean name is ambiguous. Name    za.co.knonchalant.dead.dao.repositories.UserRepository resolves to beans: 
    - CdiRepositoryBean: type='za.co.knonchalant.dead.dao.repositories.UserRepository', qualifiers=[@javax.enterprise.inject.Default(), @javax.enterprise.inject.Any()],
    - CdiRepositoryBean: type='za.co.knonchalant.dead.dao.repositories.UserRepository', qualifiers=[@javax.enterprise.inject.Default(), @javax.enterprise.inject.Any()]"}}
  </code></pre>
  
  <p>It seems to be matching the same interface twice - any idea of what might be happening?</p>
  
  <p>The <code>UserRepository</code> interface is </p>
  
  <pre><code>public interface UserRepository extends LocationRepository&lt;User&gt; { }
  </code></pre>
  
  <p>And <code>LocationRepository</code> is a general root interface for locations, that looks like</p>
  
  <pre><code>@NoRepositoryBean
  public interface LocationRepository&lt;T&gt; extends JpaRepository&lt;T, String&gt; {
      List&lt;T&gt; findByPositionWithin(Circle c);
  
      List&lt;T&gt; findByPositionNear(Point p, Distance distance);
  
      List&lt;T&gt; findByPositionWithin(Box b);
  }
  </code></pre>
  
  <p>My configuration, which I'm not overly confident in, is </p>
  
  <pre><code>@Configuration
  @EnableJpaRepositories
  public class CdiConfig {
      @Produces
      @Dependent
      @PersistenceContext(unitName = "mongo-ogm")
      public EntityManager entityManager;
  
      public
      @Bean
      Mongo mongo() throws Exception {
          return new Mongo("localhost");
      }
  
      @Produces
      public @Bean MongoTemplate mongoTemplate() throws Exception {
          return new MongoTemplate(mongo(), "mydatabase");
      }
  }
  </code></pre>
  
  <p>Along with a <code>persistence.xml</code> as per the following - is this the right provider?</p>
  
  <pre><code>&lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
      &lt;persistence-unit name="mongo-ogm" transaction-type="JTA"&gt;
          &lt;provider&gt;org.hibernate.ogm.jpa.HibernateOgmPersistence&lt;/provider&gt;
          &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
          &lt;properties&gt;
              &lt;property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/&gt;
              &lt;property name="hibernate.ogm.datastore.database" value="database"/&gt;
              &lt;property name="hibernate.ogm.datastore.host" value="localhost"/&gt;
              &lt;property name="hibernate.ogm.datastore.provider" value="MONGODB"/&gt;
              &lt;property name="hibernate.ogm.datastore.create_database" value="true"/&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>