[opencms-dev] Module Action class updateModule method

Achim Westermann Achim.Westermann at gmx.de
Thu Nov 24 08:13:57 CET 2005


Hi Mariano,

> Our company is having a hard time due to the need to restart the context
> every time a module is installed or re installed. Moreover, sometimes tomcat
> does not seem to copy the JARs needed to the WEB-INF/lib folder.

Copying the jar of the module is a matter of the export point 
WEB-INF/lib of the module's manifest.xml. I (seem to) do remember that 
the standard opencms modules have been refactored recently to import the 
jar files into the module (VFS) and then export it to WEB-INF/lib in the 
real file system.
Custom modules have to be configured to do this too.
Try configuring your module this way and install the module anew. Then 
try to trigger code-paths that use classes of your module lib without 
restart. According to Joachim tomcat already ships with a Classloader 
that supports hot deployment. I did not test this before and would be 
interested to hear, if that already does the trick.

kind regards,

Achim

> Does a "module class loader" for opencms makes sense?
> 
> Proposal:
> 
> - Build a module class loader that adds functionality to the current opencms
> modules core.
> 
> - The module class loader, upon INSTALL, should look into the WEB-INF/lib of
> the newly installed module for JARs, and load and register the classes
> inside those JARs
> 
> - The module class loader, upon UNINSTALL, should unload the classes
> registered with the module
> 
> - This module class loader should be transparent to the module developers.
> 
> If it worked on Tomcat only, I think it would be a big hit. 
> I look forward to your comments, TIA
> --mariano
> 
> 
> -----Mensaje original-----
> De: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org]
> En nombre de Joachim Arrasz
> Enviado el: Tuesday, November 08, 2005 5:35 AM
> Para: The OpenCms mailing list
> Asunto: Re: [opencms-dev] Module Action class updateModule method
> 
> Hi
> 
> 
>>the module handler class ships within your module, most often in a jar. 
>>Before an import it is not known to the JVM running.
> 
> 
> right
> 
> 
>>It will be highly depnendant on the caching of the application server's 
>>current Classloader wether dynamic class loading 
>>(class.forName("name"))") will be successful or not. Only by 
>>implementing a non - caching CL for module initialization after import 
>>this could be possible - expensive though.
> 
> 
> Well, most of todays popular servers like JBoss, Tomcat, We4bSphere ... 
> are able to check their lib folders at app's runtime. They updates the 
> cl's cache after you changed lib folders content. So it is not so 
> expensive. But you're right, not ALL servers can do this.
> 
> And it is one more point of failure for users of opencms when they have 
> to configure this manually.
> 
> Regards Achim
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 




More information about the opencms-dev mailing list