1 Reply Latest reply on Feb 16, 2014 6:50 PM by John Ament

    Ambiguous bean error in Weld SE 2.1.2

    John Ament Master

      Hi

       

      I'm working on upgrading an app from Weld 1.1.10 to Weld 2.1.2.  We're using SE mode.

       

      I went through and upgraded my beans.xml to match CDI 1.1 and set discovery to all in all of my JARs.

       

      However, when I run, I get errors like this:

       

      org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type UserRegistrationManager with qualifiers @Default

        at injection point [UnbackedAnnotatedParameter] Parameter 1 of [UnbackedAnnotatedConstructor] @Inject com.mycompany.invitation.impl.InvitationUserServiceImpl(UserRegistrationManager, @ValidationReady Event<Object>, UserAccountManager, UserLookup)

        at com.mycompany.invitation.impl.InvitationUserServiceImpl.<init>(InvitationUserServiceImpl.java:0)

        Possible dependencies:

        - Managed Bean [class com.mycompany.registration.impl.UserRegistrationManagerImpl] with qualifiers [@Any @Default],

        - Managed Bean [class com.mycompany.registration.impl.UserRegistrationManagerImpl] with qualifiers [@Any @Default]

       

      I don't get this for every class, but I do get it for classes within this specific chain (and there's 18 failures in total).  My type hierarchy looks like this:

       

      RegistrationManager (interface) -> AbstractRegistrationManagerImpl (abstract base class)

      UserRegistrationManager (extends interface) -> UserRegistrationManagerImpl (implements UserRegistrationManager, extends AbstractRegistrationManagerImpl).

       

      In total, there are 4 sets of these.  The classes that work directly with them all report this error.  I checked, both constructor based injection and field based injection throw this error.  Any idea why?