dev@glassfish.java.net

review for issue #7507 - jar file specified with deploy's --libraries not referenceable from webapp

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Fri, 3 Apr 2009 15:49:35 +1100

Hi Siva, Jerome, Kin-Man, Sahoo,

Could you assist me to fix issue #7507?
(Kin-Man reported a similar issue (#4883) and reported it was fixed, but
may that was just for WAR files, I'm seeing it for EAR files.)

I have attached a fix to the issue. I confirmed it works on V2.1.
https://glassfish.dev.java.net/issues/show_bug.cgi?id=7507

I changed the following class (who's in charge of this file?).
glassfish/appserv-core/src/java/com/sun/appserv/server/util/ClassLoaderChain.java

Could you review it?

When compiling the JSP, the classpath is taken from the
WebappClassLoader up. The path specified to the --libraries option is
kept in ASURLClassLoader, which is held by ClassLoaderChain.

ConnectorClassLoader (extends URLClassLoader)
        |
ClassLoaderChain (extends SecureClassLoader) <---
        |
EJBClassLoader (extends URLClassLoader)
        |
WebappClassLoader (extends URLClassLoader)
        |
JspLoader (extends URLClassLoader)

The classpath is constructed using URLClassLoader#getURLs but
ClassLoaderChain does not extend URLClassLoader so the path can't be
obtained that way, and it provides no method to obtain the URLs from the
classloader it holds.
The proposed patch offers that method.


This class has been refactored out in V3. Where would I put these
methods to make it work for GF V3 too?

Thanks,
Dies