8 Replies Latest reply on Feb 17, 2010 1:20 PM by Pete Muir

    Named qualifier, Weld not inline with spec

    Matthieu Chase Heimer Newbie

      I think Weld has a error in the handling of @Named as a qualifier. From section 3.11

      If an injected field declares a @Named annotation that does not specify the value member, the name of the field is assumed.
      For example, the following field has the qualifier @Named("paymentService"):
      @Inject @Named PaymentService paymentService;

      However the line: @Inject @Named PaymentService paymentService; will only match a bean class with an empty value in the @Named qualifier. If the @Named qualifier has a string value then the qualifier on the injection point must also have the same string value. You can get a javax.enterprise.inject.UnsatisfiedResolutionException with code the spec implies should function.