Skip to main content

GF4 complains about CDI failures, but I do not use CDI at all!

5 replies [Last post]
mkarg
Offline
Joined: 2007-12-09
Points: 0

I can deploy my EAR on GF3, but when I want to deploy on GF4, it fails due to the following reason:

"CDI deployment failure:WELD-001524 Unable to load proxy class for bean ..." which is (according to server.log) caused by the fact that one of my session beans overwrites a protected (!) abstract method of its super class, and declares it 'final' (in fact I even didn't know that this is forbidden, as that method is not even part of any interface, BTW).

The point is that my EAR actually does not use CDI at all (it does not even contain a beans.xml indicator file)!

So I wonder whether (a) why it is forbidden since GF4 to declare 'final' at protected methods which are not part of any interface, and why (b) GF4 complains about CDI problems when I have no beans.xml anywhere in my EAR?

Thanks!
-Markus

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hwellmann
Offline
Joined: 2008-08-16
Points: 0

beans.xml is optional in CDI 1.1. Archives may be treated as bean archives implicitly if scope annotations are present.

See https://java.net/projects/glassfish/lists/users/archive/2013-05/message/15 for a similar case.

Best regards,
Harald

codeprince
Offline
Joined: 2007-05-10
Points: 0

hwellmann,

With CDI, beans.xml is not optional, and is mandatory. Right saying should be for bean auto-discovery default behavior, beans.xml is optional in CDI 1.1.

The following is an another discussion about the topic,

http://lists.jboss.org/pipermail/cdi-dev/2013-May/004153.html

However, GF 4, I think that defaultly, enable-implicit-cdi should need to be set false.

Thanks
Tang

mkarg
Offline
Joined: 2007-12-09
Points: 0

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?

Romain Grecourt...
Offline
Joined: 2012-02-17
Points: 0

On 9/29/13 10:04 AM, forums@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
*)//
//*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
>
>

mgainty
Offline
Joined: 2004-05-21
Points: 0

Marcus makes a good point

If there are no beans to serve up then why is GF4 framework using CDI?
I think these bugs could be easily mitigated if GF4 was OpenSourced and placed as an ASF Podling

In this way the Apache devs could report, fix and one-off branch or merge to trunk any show-stopping bugs as well as roll in new features (e.g. JSR implementations)

http://incubator.apache.org/faq.html

+1 for transferring codebase and control of GF as OpenSource Project to Apache Podling

(I will volunteer as sponsor)
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

> To: users@glassfish.java.net
> Subject: Re: GF4 complains about CDI failures, but I do not use CDI ...
> From: forums@java.net
> Date: Sun, 29 Sep 2013 03:04:43 -0500
>
> 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?
>
> --
>
> [Message sent by forum member 'mkarg']
>
> View Post: http://forums.java.net/node/898688
>
>