Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Critical
-
Resolution: Done
-
Affects Version/s: 1.1.2.Final
-
Fix Version/s: 1.1.3.Final
-
Component/s: None
-
Labels:None
-
Environment:JBoss AS 7
Arquillian/TestNG
-
Workaround Description:
Description
Running org.jboss.jsr299.tck.tests.lookup.byname.ResolutionByNameTest#testFieldNameUsedAsBeanName() in CDI TCK 1.1 branch fails on deployment validation:
WELD-001408 Unsatisfied dependencies for type [Animal] with qualifiers [@Named] at injection point [[field] @Named @Inject private org.jboss.jsr299.tck.tests.lookup.byname.FishingNet.carp]"}}
After some debugging I found out that the problem is very likely related to the way default names are handled on injection point and bean definition.
Injection point:
@Inject @Named
|
private Animal carp;
|
The original qualifier is replaced if no value is specified (@Named => @Named(value="carp")). See org.jboss.weld.resolution.ResolvableBuilder(InjectionPoint).
Bean definition:
@Named
|
public class Carp implements Animal
|
The qualifier remains the same (without value; see AbstractBean#initName()) only EL name on definition is changed.
Later in org.jboss.weld.util.Beans#containsAllQualifiers() comparing the injection point new qualifier to the one on bean definition no match is found (value on @Named is binding) and thus validation fails with error message above.
Related CDI spec chapters:
2.5.2 Default bean EL names
3.1.5 Default name for a managed bean
3.11 The qualifier @Named at injection points
Gliffy Diagrams
Issue Links
- relates to
-
CDI-177
Clarify how default bean EL name and @Named qualifier with no value at injection point are related
-
- Resolved
-
Forgot to mention that the failing test is in CDI TCK 1.1 branch but problem is related to CDI 1.0 spec.