On Mon, 10 Sep 2001 18:19, Ulrich Mayring wrote:
> Hello,
>
> we have severe problems here with classloading, which we cannot
> reproduce at will. Sometimes jars in the general Avalon lib directory
> are not found by a block. Sometimes jars in a block's lib directory are
> found by other blocks (even by blocks in another .sar application),
> sometimes not even by their own block. Sometimes Avalon loads blocks and
> sars in alphabetical order, sometimes not. Something is seriously weird
> here and to put my finger on it I'd like to know how and when Avalon
> loads libraries in a multi-block, multi-sar environment like this:
>
> ~avalon/lib
>
> ~avalon/apps/foo.sar
> ~avalon/apps/foo/blocks/block1/lib
> ~avalon/apps/foo/blocks/block2/lib
>
> ~avalon/apps/bar.sar
> ~avalon/apps/bar/blocks/block3/lib
> ~avalon/apps/bar/blocks/block4/lib
>
> ~avalon/apps/baz.sar
> ~avalon/apps/baz/blocks/block5/lib
>
> Now, suppose block3 and block5 need the same jar - where do I put it?
> What is the general strategy of Avalon loading jars?

The way it is *supposed* to work is the following. 

The following are included once per JVM
<base>/lib/*.zip 
<base>/lib/*.jar 

The following are included once per application
<base>/apps/<myapp>/lib/*.jar 
<base>/apps/<myapp>/lib/*.zip
<base>/apps/<myapp>/blocks/*.bar

At this current stage there is no directory that is "shared" between apps but 
are loaded multiple times. For instance there is no way to have the same 
archives loaded into different classloaders at this point. People have 
requested this so you could have something like

<base>/share/*.jar

that would be loaded once per app. However at this stage my thinking is we 
should follow the servlet/ejb specs and they require such dependencies to be 
specified in the .jars using the jdk1.3 "Optional Package" mechanism. You 
place something like

Extension-List: required1
required1-Extension-Name: excalibur.required1
required1-Specification-Version: 1.0
required1-Implementation-Version: 1.0.2
required1-Implementation-Vendor-Id: org.apache.jakarta
required1-Implementation-URL: 
http://jakarta.apache.org/avalon/excalibur/required1.jar

In any jar that depends on this shared library. I am about halfway through 
implementing the infrastructure for it at the moment but I wont have the 
chance to finish it in near future.

-- 
Cheers,

Pete

*-----------------------------------------------------*
| Never argue with an idiot, they'll drag you down to |
| their level, and beat you with experience           |
*-----------------------------------------------------*

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to