Posted by
Adam Heath-2 on
URL: http://ofbiz.116.s1.nabble.com/OFBiz-libraries-versus-Hot-deployed-component-ones-tp1573363p1573692.html
Christopher Snow wrote:
> Adam Heath wrote:
>> Christopher Snow wrote:
>>
>>> I think each component gets its own class loader, so this should be
>>> happening anyway.
>>>
>>
>> No, there is a single classloader for all of ofbiz.
>>
>>
> Thanks for clarifying Adam.
It's actually slightly more complex.
start.jar begins, and it can only see itself.
It is then hard-coded(sorta, thru the use of internal properties files
embedded in the jar) to find all libraries in framework/base/lib, and
add then to an initial classloader.
This classloader contains the container and component loading logic.
That finds the rest of ofbiz, and creates a second classloader. Note,
that this second classloader has duplicate framework/base libs, and
that the first one might have framework/base libs that it shouldn't,
because the ofbiz-component.xml for base may not include some library
folder.
Then, all the containers start. One of those is catalina. For each
web-app, it does create a separate classloader, and it might be
possible to override libraries there, by using WEB-INF/lib. But this
is not the standard ofbiz way.