Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't add libraries to shared.loader

 
Guy Yafe
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
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?

Thanks,
Guy
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Guy Yafe
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Guy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic