This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 239864

Summary: False warning about missed beans.xml
Product: javaee Reporter: kidnapper <kidnapper>
Component: CDIAssignee: Sergey Petrov <sj-nb>
Status: RESOLVED WONTFIX    
Severity: normal CC: mike1024, pjiricka
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description kidnapper 2013-12-30 01:44:50 UTC
Steps to reproduce:
* create a Java EE 6 project
* add Guice to the project as a dependency and implement an AbstractModule
* try to use @Inject on a constructor with parameters bound correctly in your Guice module#configure

The following error message is shown:
"CDI artifact is found but there is no beans.xml file."

It is an error message and is marked with red line, which is quite confusing: I'm not using CDI, I'm using Guice, hence I don't need to have a beans.xml at all. In general this bug is quite similar to #230730 however the fix for this wasn't really handling non-CDI cases.

A preferred solution for this would be to turn this error into a warning (which can be even disabled), so it works for non-CDI use-cases.

Possible workaround:
use @com.google.inject.Inject instead of @javax.inject.Inject...
Comment 1 Sergey Petrov 2014-01-15 13:49:48 UTC
In my opinion Guice support issues may not deserve P2 status, but anyway cdi hints should be managed the same way as most others, i.e. should be possible to configure hint level warning/error and disable also
Comment 2 Sergey Petrov 2014-01-17 12:41:50 UTC
I may be wrong but it looks current cdi hints implementation is hard to change to hints api with enable/disable support it's comparable in complexity with task in jpa area, and I don't expect to implement it in current release. Guice recognition (and may be some other similar frameworks) is another option also.
Comment 3 Sergey Petrov 2014-03-21 14:52:40 UTC
I was a bit wrong about Guice, as I've found some support inside
Comment 4 mike1024 2015-04-28 09:15:49 UTC
I've also encountered this bug - no Guice here, I'm using HK2 (which is the foundation of Jersey 2) with Java 8 and Netbeans 8.

So this isn't a Guice-only problem, or a Java 6 only problem, or a Netbeans 7.4 only problem.

Any news on a fix? Or is there a plugin I can disable or something to make the error go away?
Comment 5 Martin Balin 2016-07-07 08:56:43 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss