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 252123 - CdiUtil.isEnabled reports false when server supports CDI 1.1 or higher
Summary: CdiUtil.isEnabled reports false when server supports CDI 1.1 or higher
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: CDI (show other bugs)
Version: 8.0.2
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-27 22:51 UTC by kwrobel
Modified: 2015-04-27 22:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kwrobel 2015-04-27 22:51:55 UTC
I am working on a project that generates code (nbpfcrudgen on SF). Part of what is being generated relates to Injection. As such, my code utilizes the CdiUtil.isCdiEnabled method. Testing with Glassfish 4.1 which is based on JEE 7 and ships with an OSGi bundle of WELD 2.2.2 according to Glassfish web site, the proper result should be True. WELD 2.2.2 incorporates CDI 1.2 spec, and so this should be properly reported back as true.

There is a method called isCdi11OrLater, but it also returns false. For my project, this can easily be worked around by adding the beans.xml file to a web project, though for a JEE 7 web app, this shouldn't be necessary anymore. Even the New Web Application wizard automatically remove the old "Enable CDI" check box. So it stands to reason that CDI capability is already detected inside NetBeans at project generation time.

Could someone please advise on this situation?