Shared Library in Tomcat6.0
While working on a issue, I found that Tomcat 6.0 does not have any directory where we can put third-party jars (like our “<$pserver>/server/lib/ext” directory). Couple of hits on google revealed that now it is configurable rather than putting the file physically inside $CATALINA_HOME. It is something like a pluggable entity, put the jars into a directory and just provide the aboslute path inside conf/catalina.properties file. Inside this file, change the following property:
shared.loader
Eg:
shared.loader=E:\\shared\\drivers\\mysql-connector-java-3.1.11-bin.jar
But these jar will be picked up dynamically. Rather, Tomcat 6.0 needs a restart after this. And Driver will be loaded.
Please note that, prior to this version of Tomcat, external/third party jar could be placed inside following locations:
1) ${catalina.base}/shared/lib/ – jar needs to be shared by all the deployed applications only(to share classes across all web applications)
2)${catalina.base}/common/lib/ – jar need to be shared by web server and applications.

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments
No comments yet.
Leave a comment