You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Stephen Brooksbank (Jira)" <ji...@apache.org> on 2021/01/14 15:49:00 UTC

[jira] [Created] (NETBEANS-5246) incorrect Unresolved Ambiguous Dependency warning

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-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

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