I a nagging question about how to best make use of Tomcat's shared/lib directory that I can't seem to find a solid answer for:
Is there any chance that putting jars which are used over and over in different contexts and virtual hosts into tomcat/shared/lib will cause interaction problems across contexts? Specifically, I remember reading something a while back about Struts and Jakarta Commons libraries interacting with each other in subtle and unpleasant ways when shared in this way instead of each residing in their respective WEB-INF/lib directory.
The only thing that comes to mine is static objects that you intended only to exist accross applications could exist accross multiple non-related applications. I don't know about the specific problems that could arise in the libraries you mention, but as a general rule its a bad practice for most application-related jars.
That makes sense. It seems that the "don't put struts jars in a shared lib" advice I remember revolved around that, too. I believe the other possible gotcha is that WEB-INF/lib jars can see those in shared/lib, but not the other way around, which is the only one I could come up with when I posted.
/shared/lib should not be used for sharing java libraries. The name is ambiguous, i know, but this dir is to share libraries between applications and *tomcat container*. You dont want to mess with Tomcat core, do you?
To share libraries between applications only you should use /common/lib