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

Ambiguous dependency not detected for (two) session beans with the same name

    Details

      Description

      Two session beans:

      • same name
      • implementing the same local interface (Animal) and declaring no other views
      • deployed in two different modules, one module (A) is visible to the other (B).

      When trying to inject Animal in the module B, once I get an instance of the first bean, next time an instance of the second one. The correct behavior would be DeploymentException due to ambiguous dependency.

      interface Animal {}
      
      @Stateful(name = "Animal")
      public class Cat implements Animal {}
      
      @Stateful(name = "Animal")
      public class Dog implements Animal {}
      
      public class Bar {
          @Inject
          private Animal animal;
      }
      

      Deployment structure:
      EAR

      • ejb.jar: Animal, Dog
      • test.war: Bar, Cat

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bafco Matus Abaffy
                  Reporter:
                  bafco Matus Abaffy
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: