users@glassfish.java.net

Re: GF4 complains about CDI failures, but I do not use CDI ...

From: JJ Snyder <j.j.snyder_at_oracle.com>
Date: Mon, 30 Sep 2013 12:46:35 -0400

CDI 1.1 has a new feature called implicit bean deployment archives. It
allows CDI to be enabled automatically for archives that make up an
application. Please see the following sections of the CDI 1.1 spec:
2.5 Bean Defining Annotations
12.1 Bean Archives

Implicit CDI is enabled by default in GF 4. Romain's instructions for
disabling implicit CDI is correct.

JJ

On 09/29/2013 10:43 PM, Romain Grecourt wrote:
> On 9/29/13 10:04 AM, forums_at_java.net wrote:
>> So do I understand correctly: GF4 has CDI enabled by default, even
>> for EAR
>> not containing a beans.xml file? Is that a new Java EE 7 feature, or
>> just a
>> GF4 trick?
> See the following quote from https://java.net/jira/browse/GLASSFISH-20579
>
> /If you were to add a beans.xml, with the cited exclude config, to the
> guava jar, then you should see the behavior you're expecting.//
> //Assuming that you don't want to modify the guava archive, I think
> you'll find the following asadmin deployment property to be useful://
> //--property implicitCdiEnabled=false//
> //(Example: *asadmin deploy --property implicitCdiEnabled=false
> <archive>*)//
> //*This property will force the CDI 1.0 behavior wrt implicit bean
> discovery* for the archive being deployed, rather than the
> aforementioned server-wide configuration./
>
> Thanks,
> Romain
>>
>> --
>>
>> [Message sent by forum member 'mkarg']
>>
>> View Post: http://forums.java.net/node/898688
>>
>>
>