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

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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.1.10.Final, 1.1.13.Final
    • Fix Version/s: 1.1.14.Final
    • Component/s: None
    • Labels:
      None

      Description

      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;

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                luksa Marko Luksa
                Reporter:
                jjsnyder Joseph Snyder
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: