users@glassfish.java.net

Re: Application Libraries - domains/domain1/applibs

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Fri, 03 Aug 2007 14:07:15 +0530

Hi Jan

There is one [albeit, minor?] issue in considering extra-class-path as an
equivalent to "--libraries". As mentioned in [1], using --libraries allows

"If multiple applications or modules refer to the same libraries, classes in
those libraries are automatically shared."

[ie we load two applications referring to foo.jar via --libraries in the same
classloader and hence enabling shared static state/less classloading etc]

whereas with extra-class-path the libraries specified are loaded by the web
module classloader and hence no sharing across WARs is done.

Thanks
--Siva.
[1] http://docs.sun.com/app/docs/doc/819-3659/6n5s6m57l?a=view

glassfish_at_javadesktop.org wrote:
> In response to:
>
> >Currently, there is no way of providing library dependencies in the sun DD. It
> > is an option specified during the deployment of the application.
>
> Actually, there is a way: use the "extra-class-path" attribute of the <class-loader> element in sun-web.xml. Relative paths are interpreted as relative to the webapp's docroot.
>
> Example:
>
> <sun-web-app>
> <class-loader extra-class-path="WEB-INF/lib/extra/extra.jar"/>
> </sun-web-app>
>
> See also https://glassfish.dev.java.net/issues/show_bug.cgi?id=904
> ("extra-class-path attribute in <class-loader> should allow path relative to docroot")
> [Message sent by forum member 'jluehe' (jluehe)]
>
> http://forums.java.net/jive/thread.jspa?messageID=229240
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>