One issue you might face in this configuration is if you have multiple versions of the same library existing on the same path, let's say com.example v1.0 and v2.0, and each is a dependency for one or more webapps. If a webapp depending on 2.0 requires class com.example.X which is available in both versions, and if the class loader looks in v1.0 jar file first, then you might see some CNF exceptions and such.
To workaround this ensure both statements below are true: 1. The class loader searches in WEB-INF jar files before common.loader (I think it should be the case) 2. Update your build process to include in WEB-INF only jar files that have an older version in common.loader path (just to not break any webapp especially the one being installed). If you end up updating all webapps to use the latest version of the library com.example, you'll end up with all webapps having the latest version in WEB-INF and the unused older version in common.loader path. Then update the common.loader path by removing the old version and adding the new one, and remove it from WEB-INF directories. This might incur more work on managing the webapps. But if you could have an automated build process that decides where to put dependency jar files and have it as a step for all webapps builds, then it could be a time/space saver later. Regards, Nasry Al-Haddad Sent from BlueMail On Nov 25, 2017, 16:35, at 16:35, rich...@xentu.com wrote: >I've written a few jersey webapps, and each has about 20 jar files >included as Maven dependencies. > >The inclusion of those jars increases the size of the resulting wars by > >a factor of over 100. Uploading a war via 'Tomcat Web Application >Manager' takes several minutes, presumably due in part to the war size. > >Given that these webapps require the same set of jars in their >WEB-INF/lib/, I thought I could place them in say > >C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\jersey > >where all webapps could find them. > >In catalina.properties, I appended this new directory to the >common.loader list of paths: > >common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar, > >${catalina.base}/lib/jersey/*.jar > >Then, in each jersey webapp, I'd modify pom.xml to exclude those files >from the war. > ><plugin> > <artifactId>maven-war-plugin</artifactId> > <version>3.2.0</version> > <configuration> > <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> > </configuration> ></plugin> > >This approach seems to work. > >So, the question I'm seeking advise on is this: > >If I have a collection of jars that I want to keep on Tomcat, for some >but not all webapps, and those jars are not to be included in the wars, > >is this an acceptable technique? Or is it going to land me in trouble? >Does the order of locations in common.loader matter? > > >Thanks for any advice >Richard > >--------------------------------------------------------------------- >To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >For additional commands, e-mail: users-h...@tomcat.apache.org