users@glassfish.java.net

Re: Application Libraries - domains/domain1/applibs

From: <Jan.Luehe_at_Sun.COM>
Date: Fri, 03 Aug 2007 12:31:44 -0700

Hi Siva,

Sivakumar Thyagarajan wrote:

> 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.


I completely agree. When you mentioned:

>Currently, there is no way of providing library dependencies in the
sun DD. It
> is an option specified during the deployment of the application.

I wanted to make sure that the user knew that there was a config option in
sun-web.xml to specify dependencies on libraries outside the search path
mandated by the spec, using the "extra-class-path" attribute.

Of course, any such dependencies will be resolved for the particular webapp
alone, and will not be exposed to any other webapps for sharing.


Jan


>
> 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
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>