-
1. Re: WELD-001409 Ambiguous dependencies for type EntityManager
lightguard Oct 28, 2011 1:48 PM (in response to ansarbasha)Remove one of the listed producer methods
-
2. Re: WELD-001409 Ambiguous dependencies for type EntityManager
ansarbasha Nov 3, 2011 1:17 PM (in response to ansarbasha)How can i remove from this class and if i remove how should i create entitymanager.
package org.jboss.forge.persistence;
public class TimesheetDatasourceProducer implements Serializable {
private static final long serialVersionUID=-5267593171036179836L;
@PersistenceUnit private EntityManagerFactory emf;
@Produces @SessionScoped public EntityManager createEM(){
return emf.createEntityManager();
}
public void close( @Disposes EntityManager em){
em.close();
}
}thanks
ansar -
3. Re: WELD-001409 Ambiguous dependencies for type EntityManager
lightguard Nov 3, 2011 2:19 PM (in response to ansarbasha)As there's no additional persistence unit being used it looks like, you should be safe to simply remove one of the classes. You have two classes that are producing an EntityManager with the same qualifiers, one of them needs to be deleted.
-
4. Re: WELD-001409 Ambiguous dependencies for type EntityManager
ansarbasha Nov 5, 2011 11:16 AM (in response to ansarbasha)I have two different applications, developed in seam 3 using seam forge, one get properly deployed for other one i get this error, i cannot deploy more than one app, this is on jboss 6 latest build, jboss 7 has lots of changes to be done, so i'm differing it for some time.
thanks
ansar -
5. Re: WELD-001409 Ambiguous dependencies for type EntityManager
lightguard Nov 7, 2011 12:59 PM (in response to ansarbasha)Ansar, what you are seeing is there are two producers for the EntityManager with the exact same qualifiers, one of them must be removed. I can't say it another way.
-
6. Re: WELD-001409 Ambiguous dependencies for type EntityManager
ansarbasha Nov 8, 2011 5:15 AM (in response to ansarbasha)Jason,
Looks like you have not read the post properly, these are two different applications, i did the changes you suggested long back before posting here, even after changing the things you are suggesting i get same error for different objects like
WELD-001409 Ambiguous dependencies for type Synchronizations] with qualifiers [@Default] at injection point [[parameter 1] of [method] @Inject public org.jboss.seam.transaction.EntityTransaction.init(Synchronizations)
if i change this i'll get error in another object either with logger or some other object, i hope you are understanding, t too cannot put in simple words than this.
ansar
-
7. Re: WELD-001409 Ambiguous dependencies for type EntityManager
lightguard Nov 8, 2011 12:33 PM (in response to ansarbasha)Sorry about that.
I'm not sure which package that's coming from, the jpa-api jar perhaps? It looks like you have two jars containing that class on the class path. Please list the jars in your application.