Stephen Brooksbank created NETBEANS-5246:
--------------------------------------------

             Summary: incorrect Unresolved Ambiguous Dependency warning
                 Key: NETBEANS-5246
                 URL: https://issues.apache.org/jira/browse/NETBEANS-5246
             Project: NetBeans
          Issue Type: Bug
          Components: javaee - CDI
    Affects Versions: 12.2
         Environment: Windonws / Netbeans 12.2 / Java OpenJDK 11 / Wildfly 21 / 
Weld / Mojarra 2.3.14.SP01
            Reporter: Stephen Brooksbank
         Attachments: Car.java, CarCatalog.java, CodeCompletion1.png, 
CodeCompletion2.png, EL lookup failing.png, IndexController.java, Unresolved 
Ambiguous Dependency.png, index.xhtml

I'm getting an "Unresolved ambiguous dependency" warning when I inject a CDI 
bean.

!Unresolved Ambiguous Dependency.png!

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:

!EL lookup failing.png!

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:

!CodeCompletion1.png!

and this if I have a similar field in the backing bean for the page (when code 
completion works ok):

!CodeCompletion2.png!

Code samples are attached.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to