persistence@glassfish.java.net

TopLink tries to initialize classes while loading

From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
Date: Thu, 08 Dec 2005 18:03:01 +0530

Hi Tom,

Earlier I had raised this once. Is it necessary for the classes to be
initialised when they are being loaded for introspection purpose? I
don't think so. In that case, can TopLink Essential code be changed not
to initialize classes while loading them? I found the following code in
TransformerFactory.java by accidentally entering into that file while
debugging:
                Class clz =
oracle.toplink.essentials.internal.security.PrivilegedAccessController.getClassForName(descriptor.getJavaClassName(),
true, classLoader);

We have had bugs raised by our customers for such issues especially when
static-initializer code assumes it is running in an active application
context.

Thanks,
Sahoo