geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Multiple SharedLibs
Date Tue, 11 Aug 2009 17:42:01 GMT

On Aug 11, 2009, at 9:21 AM, vaughn_m wrote:

>
> When I tried the previous way I get class not found exceptions that  
> relate to
> the classes in the targeted directory.  I realize the repository is  
> the best
> way to go however, I am deploying web apps that have several jars  
> (20 or so)
> that need to be shared by several web apps.  I have not had a chance  
> but if
> there is a tool that can assist in creating the repository for each  
> jar set,
> that would be tremendously helpful.  I will give it a whirl again  
> and let
> you know my final outcome.

I you use maven, you can pre-deploy your web apps as geronimo plugins  
with dependencies on the jars you need to share.  Then, installing the  
plugin will also pull in all the jars to the appropriate locations in  
the geronimo repository.  This gives each web app a the jars in the  
web app classloader.  If you need the jars to all be in the same  
classloader you can either make all but one web app have a dependency  
on a particular web app or, better, set up a "classloader" plugin with  
dependencies on all the jars and each web app with a dependency on the  
classloader plugin.

There's a little documentation at
http://cwiki.apache.org/GMOxDOC22/administering-plugins.html
which may be more visible at
http://cwiki.apache.org/confluence/display/GMOxDOC22/Administering+plugins

The geronimo build itself is full of examples of plugins and has  
several classloader plugins (under e.g plugins/classloaders).

This should be simpler in the future with geronimo 3 and osgi :-)

hope this helps
david jencks

>
> Thank you for you help,
>
> Vaughn
>
>
> djencks wrote:
>>
>> The plan you show below should work if you include a dependency on  
>> the
>> resulting plugin in your actual app.
>>
>> The difference between this and the technique Chi Runhua suggested is
>> that with your separate plan your <geronimo-home>/var/app/lib jars
>> will always be loaded in the applib classloader, which will be a
>> parent of each app classloader, whereas with Chi Runhua's suggestion,
>> each app will get their own copy of the classes.
>>
>> This might sound stupid, but how do you know this isn't working?
>>
>> I also really suggest you rethink the relative convenience of using
>> the geronimo repository and a custom shared lib folder.  If you are
>> dead set against using maven, then this might make sense, otherwise I
>> recommend you try setting up a maven build of a custom server  
>> assembly
>> that includes your apps.
>>
>> thanks
>> david jencks
>>
>> On Aug 11, 2009, at 4:13 AM, vaughn_m wrote:
>>
>>>
>>> Hello -
>>>
>>> I am trying to create 4 different shared lib folders in different
>>> directories.  I have read and tried to use the
>>> org.apache.geronimo.system.sharedlib.SharedLib gbean (the plan is
>>> below) in
>>> the various web apps that might use the specific directory. But this
>>> has
>>> been unsuccessful.  If I place my jars in the sharedlib folder
>>> (var/shared/lib) it works perfectly. But if I place the jars in the
>>> specified lib folder and remove the jars form the shared folder the
>>> application will not deploy.  I need to separate these libs in
>>> different
>>> folders so I can have an upgrade path for different components down
>>> the
>>> road.  While I could use the repository as a last resort, it would
>>> be more
>>> convenient for me to reuse the SaredLib gbean to accomplish this
>>> task by
>>> referencing a specific external folder.  Any insight anyone would
>>> have would
>>> be helpful.  See the plan below for a reference.
>>>
>>> Vaughn
>>>
>>> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
>>> <!--Company Web App-->
>>> <environment>
>>>   <moduleId>
>>>     <groupId>com.company.app</groupId>
>>>     <artifactId>applib</artifactId>
>>>     <version>2.2.07</version>
>>>     <type>car</type>
>>>   </moduleId>
>>>   <dependencies>
>>>     <dependency>
>>>       <groupId>org.apache.geronimo.framework</groupId>
>>>       <artifactId>rmi-naming</artifactId>
>>>       <version>2.1.4</version>
>>>       <type>car</type>
>>>     </dependency>
>>>   </dependencies>
>>>   <hidden-classes/>
>>>   <non-overridable-classes/>
>>> </environment>
>>> <gbean name="AppSharedLib"
>>> class="org.apache.geronimo.system.sharedlib.SharedLib">
>>>   <attribute name="classesDirs">var/app/classes</attribute>
>>>   <attribute name="libDirs">var/app/lib</attribute>
>>>   <reference name="ServerInfo">
>>>     <name>ServerInfo</name>
>>>   </reference>
>>> </gbean>
>>> </module>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Multiple-SharedLibs-tp24915605s134p24915605.html
>>> Sent from the Apache Geronimo - Dev mailing list archive at
>>> Nabble.com.
>>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Multiple-SharedLibs-tp24915605s134p24920901.html
> Sent from the Apache Geronimo - Dev mailing list archive at  
> Nabble.com.
>


Mime
View raw message