dev@glassfish.java.net

Can EJBClassLoader be turned into a URLClassLoader?

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Fri, 21 Apr 2006 15:22:24 -0700

Would it be possible to have com.sun.enterprise.loader.EJBClassLoader
extend java.net.URLClassLoader, like most classloaders in the
appserver's classloader hierarchy already do?

When searching for TLD resources in the classloader delegation chain,
the webcontainer currently only considers classloaders that are
instances of URLClassLoader, and scans each URL returned by getURLs()
for TLDs. Since EJBClassLoader, which is installed as the parent of a
webmodule's WebappClassLoader, does not extend EJBClassLoader, its JAR
files are skipped, causing

    https://glassfish.dev.java.net/issues/show_bug.cgi?id=590

We'd like to avoid special-casing EJBClassLoader, and also must avoid
referencing the EJBClassLoader symbol from the webcontainer code.

EJBClassLoader currently extends java.security.SecureClassLoader,
which it no longer would have to do once it extended URLClassLoader,
which in turn already extends SecureClassLoader.

 From looking at the EJBClassLoader source code, it seems like
converting it to a URLClassLoader should be an easy task, since it
already manages its resources as a set of URLs (which it exposes via
its getURLs() method).

Comments?

Thanks,


Jan