Multiple projects in TOMCAT share LIB packages

1. Create a new shared/lib directory structure in the tomcat root directory, put the jar package of the project in this directory, and remember to delete the jar package under the project (usually in the WEB-INF\lib directory of the project).

2 Modify the catalina.properties file in the conf directory of tomcat, mainly modify two places

     1) The value of shared.loader is changed to all the jar packages in the shared jar package directory created by yourself, in this example:

shared.loader=D:/ Program Files/Tomcat7/shared/lib/*.jar

     2) Comment out all the values ​​of tomcat.util.scan.DefaultJarScanner.jarsToSkip and add *.jar. This example is:

tomcat.util.scan.DefaultJarScanner.jarsToSkip=\         

*.jar

Effect: The startup speed of tomcat is accelerated after modification.

           At the same time, it prevents tomcat from loading repeated jar packages in the project multiple times, resulting in abnormal memory removal.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326450695&siteId=291194637