I am using the latest Tomcat version: 7.0.30.
I want to add an external library to the class loader, so web applications can use other classes I have written.
I tried adding the path to the shared.loader property in the catalina.properties file, and Tomcat just ignored this property and did not load my classes.
When I added the same path to the common.loader proprty, it worked perfectky and Tomcat loaded all my classes and the application worked well.
Has anyone encountered this problem before?
Is there another property I should set? Maybe I need to explicitly tell Tomcat to use the shared loader?
Actually, sharing classes between webapps is not a recommended practice. Webapps are supposed to be self-contained for one thing. Plus a lot of people who try don't address proper thread-safety in their libraries, and shared classes MUST allow for unexpected multi-threading issues.
An IDE is no substitute for an Intelligent Developer.
Joined: Sep 30, 2011
Thanks, I am aware of this approach.
Still, I want to have some common libraries for all my applications: User managment (Like BaseUser object) and some Logging utilities.
Is there a way to put these libraries inside the shares.loader property instead of the common.loader?