7 Replies Latest reply on Nov 8, 2011 12:33 PM by Jason Porter

    WELD-001409 Ambiguous dependencies for type EntityManager

    ansar basha Newbie

      Hi,


      Environment: seam 3 and jboss as 6.1


      I have create two applications using seam forge and deployed on JBoss 6.1.0.Final, i can deploy these applications individually, however if I deploy these application together its throwing following exception, one application is getting deployed properly while the other application is not  and this second application throws following error.


      16:46:33,246 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///C:/Users/hiq/workspace2/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_
      6.0_Runtime_Server1319125456744/deploy/timesheet.war_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [EntityManager] with qualifiers [@Default] at injection point [[field] @Inject protected uk.co.hiq.timesheet.view.TactivityBean.tsEntityManager]. Possible dependencies [[Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[method] @Produces @ConversationScoped public org.jboss.forge.persistence.TimesheetDatasourceProducer.createEM()], Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[method] @Produces @ConversationScoped public org.jboss.forge.persistence.DatasourceProducer.create()]]]



      I tried adding @qualifier custom annotation for producer method of the Entitymanager but it started giving same problem with other objects in seam persistance as shown below.


      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)].


      Any suggestions for resolution for this problem will be highly appreciated.


      ansar