arch@glassfish.java.net

Re: [arch] Stricter library reqts in EE 6 vs GlassFish v2 behavior

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Tue, 12 May 2009 14:37:13 -0700

Marina Vatkina wrote:
> Bill Shannon wrote:
>> I don't understand.
>>
>> What exactly do you mean by "package private access of the members of
>> such classes" and who does that?
>
> Ejb devtests (but there is no guarantee that GF users don't have similar
> cases) have classes packaged into a shared jar that are in the same
> package as the ejbs that are in their own ejb jar(s). Those helper
> classes have no access modifiers on the member variables, so the ejbs
> access those fields directly.
>
> In v2 it was fine because we used the same class loader for all of it.
> In v3 shared jar in the lib is loaded by its own classloader.
>
> Does it make sense?

Yes.

People who do that are crazy.

:-)

Seriously, expecting to access package private members when you're in a
completely different jar file just seems like you're asking for trouble.
That depends far too much on the (normally unspecified) details of class
loading. We can certainly write this down in the compatibility section
of the manual (in tiny font, way in the back), but I wouldn't expect
many real applications to run into this.