Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-12402

Ambiguous EL names in case of producers of alternative bean classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.0.0.Alpha1
    • 3.3.0.Final
    • cdi
    • None

      See the example from https://github.com/pmuir/jboss-as-developer-guide/tree/master/quickstarts

      There is org.jboss.as.quickstarts.login.EJBUserManager:

      org.jboss.as.quickstarts.login.EJBUserManager
      ...
      @Named("userManager")
      @RequestScoped
      @Alternative
      @Stateful
      public class EJBUserManager implements UserManager {
      ...
          @Produces
          @Named
          @RequestScoped
          public List<User> getUsers() throws Exception {
              ...
          }
      ...
      }
      

      And there is also another bean org.jboss.as.quickstarts.login.ManagedBeanUserManager:

      org.jboss.as.quickstarts.login.ManagedBeanUserManager
      ...
      @Named("userManager")
      @RequestScoped
      public class ManagedBeanUserManager implements UserManager {
      
         @SuppressWarnings("unchecked")
         @Produces
         @Named
         @RequestScoped
         public List<User> getUsers() throws Exception {
             ...
         }
      ...
      }
      

      We have two beans with EL name #

      {users}

      Try to inject it in some bean:

      @Inject List<User> users;

      There is a warning about ambiguous beans that is not correct.

      See WELD-930 for details.

              scabanovich Viacheslav Kabanovich (Inactive)
              alexeykazakov Alexey Kazakov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: