1 Reply Latest reply on Aug 9, 2016 10:23 AM by Martin Kouba

    AmbiguousResolutionException: WELD-001318: Cannot resolve an ambiguous dependency between

    Bruce Springfield Apprentice

      Try to run a Junit test with WeldJUnit4Runner and get the following error message:

       

      org.jboss.weld.exceptions.AmbiguousResolutionException: WELD-001318: Cannot resolve an ambiguous dependency between:

        - Managed Bean [class com.my.own.bounded_contexts.client.rest.SendBean] with qualifiers [@Any @Default],

        - Managed Bean [class com.my.own.bounded_contexts.client.test.SendBeanMock] with qualifiers [@Any @Default]

        at org.jboss.weld.manager.BeanManagerImpl.resolve(BeanManagerImpl.java:1235)

        at org.jboss.weld.bootstrap.Validator.validatePseudoScopedInjectionPoint(Validator.java:930)

        at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:906)

        at org.jboss.weld.bootstrap.Validator.validatePseudoScopedInjectionPoint(Validator.java:936)

        at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:906)

        at org.jboss.weld.bootstrap.Validator.validatePseudoScopedBean(Validator.java:883)

        at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:138)

        at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)

        at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)

        at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)

        at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)

        at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)

        at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

       

      Any solutions or workarounds for this issue?