Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
12.2
-
None
-
None
-
Windonws / Netbeans 12.2 / Java OpenJDK 11 / Wildfly 21 / Weld / Mojarra 2.3.14.SP01
Description
I'm getting an "Unresolved ambiguous dependency" warning when I inject a CDI bean.
If I simply ignore the warning message. The application runs correctly and WELD does not report any issues when the application is deployed.
This issue does not happen always. It appears to be when generics are being used. In the example above Car.class is a simple POJO. I've got a SessionScoped CarCatalog.class that @Produces a List<Car>. This reference is sufficient to make it unique to CDI and should not be causing a warning in NetBeans.
There is a related issue in EL code completion:
If I reference the same CDI object in EL, no code completion is available, presumably implying no match has been found. Again, if I manually complete the field and ignore the warning triangles, the code deploys and runs OK.
The suggestions it is generics related, if I use code completion on h:datatable, I get this for the CDI bean:
and this if I have a similar field in the backing bean for the page (when code completion works ok):
Code samples are attached.