Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1451

Injection of Specialized ejb via its interface causes WELD-001409 Ambiguous dependencies exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.14.Final
    • 1.1.10.Final, 1.1.13.Final
    • None
    • None

      Injecting a session bean that specializes another session bean is failing deployment due to an ambiguous dependency exception. The reason for the exception is because the injection point injects by the interface of the EBJs. If I make the injection point type the EJB class it successfully deploys. Below is the summary of the classes that are included in the attachment.

      This works ok in Weld 2.0 with GlassFish but fails on existing WLS which
      is using 1.1.10.Final and also fails with 1.1.13.Final.
      Class Summary:
      @Local
      public interface AccountBeanLocal {}

      @Stateless
      public class AccountBean implements AccountBeanLocal {}

      @Stateless
      @Specializes
      public class MockAccountBean extends AccountBean {}

      public class EarSpecializeServlet extends HttpServlet {}
      @Inject
      AccountBeanLocal bean;
      ...
      }

      If I change the injection point to the super class then it deploys fine.
      @Inject
      AccountBean bean;

              marko.luksa@gmail.com Marko Luksa (Inactive)
              jjsnyder Joseph Snyder (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: