Re: OFBiz libraries versus Hot-deployed component ones

Posted by Chris Snow-3 on
URL: http://ofbiz.116.s1.nabble.com/OFBiz-libraries-versus-Hot-deployed-component-ones-tp1573363p1573713.html

Adam Heath wrote:

> Christopher Snow wrote:
>  
>> Adam Heath wrote:
>>    
>>> 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.
>>>  
>>>      
>> OSGi would be a nice solution to this problem!
>>    
>
> What problem?
>
>  
Control over which version of a library you depend on without having to
setup and manage your own classloader.