Marc,

The only issue with having jars in common/lib, is that any static class
variables are shared across every webapp, as the class loader only loads
these classes once per server.  Classes under webapp/WEB-INF/lib are loaded
once per webapp and invisible to other webapps. 

For example, if you're using log4j, you can get every webapp logging to the
same file, even if each webapp initialises logging separately (the webapp
that initialises last "wins").  This is because log4j uses static variables
to hold log configuration.  To prevent this, I keep a copy of log4j.jar in
webapp/WEB-INF/lib for every webapp.  I keep most other jars in common/lib
though

This is not to say that everything should be in webapp/WEB-INF/lib, just
that its worth knowing that there can be confusing consequences of sharing
jars across webapps.

Andy

> -----Original Message-----
> From: Wangenheim, Marc [mailto:[EMAIL PROTECTED]
> Sent: 11 June 2004 15:18
> To: Tomcat Users List
> Subject: RE: Common/lib works shared/lib doesn't
> 
> 
> OK I'll leave it in common/lib. The problem with WEB-INF/lib is that is
> takes too much time to update all webapps. We have a rather cumbersome
> environment. Each app has to go through four environments (development,
> integration, certification, production) before it is available to the
> customer. Hopping from one environment to the next can take up to two
> days each because after Sarbanes-Oxley all we developers have access to
> is development and that's it. Now imagine I have 30 apps using this jar.
> If I need to make a change to the jar it becomes a nightmare to deploy.
> 
> Thanks for the help tho =)
> 
> 
> 
> -----Original Message-----
> From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 11, 2004 9:56 AM
> To: Tomcat Users List
> Subject: RE: Common/lib works shared/lib doesn't
> 
> 
> 
> Hi,
> It's OK to leave it in common/lib.  (IMHO it's also fine to have a copy
> for each webapp in WEB-INF/lib, but you stated you don't want that).
> 
> Yoav Shapira
> Millennium Research Informatics
> 
> 
> 
> **********************************************************************
> 
> The content of this e-mail message and any attachments are confidential
> and may be
> 
> legally privileged, intended solely for the addressee.  If you are not the
> intended
> 
> recipient, be advised that any use, dissemination, distribution, or
> copying of this
> 
> e-mail is strictly prohibited.  If you receive this message in error,
> please notify
> 
> the sender immediately by reply email and destroy the message and its
> attachments.
> 
> **********************************************************************
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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

Reply via email to