As more and more projects are deployed, more and more release packages will be deployed in Tomcat. In this way, it is inevitable that many identical jars will be loaded, occupying a large amount of permanent storage area memory. By setting shared lib, only one identical jar is loaded. This has the following benefits: 1. Avoid loading the same jar in different projects to reduce the memory usage of the permanent storage area 2. Improve the startup speed of Tomcat because fewer duplicate jars are loaded 1. How to set up shared libMethod 1:Modify the catalina.properties file under the conf file and configure the path of shared.loader: Configure the absolute path: shared.loader="D:hs/develop/shared/lib","D:/hs/develop/shared/lib/*.jar" After that place the same jar under the specified folder. Or configure relative path: shared.loader="${catalina.base}/shared/lib","${catalina.base}/shared/lib/*.jar" Then create a new shared directory in the same directory as conf and put the same jar in lib Method 2:Modify the catalina.properties file under the conf file, configure the path of common.loader, and append the path of shared lib: common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar","${catalina.home}/lib/shared/*.jar" Then create a shared directory in the lib folder and put the same jar in the shared directory 2. The difference between catalina.home and catalina.baseUnder a tomcat, catalina.home and catalina.base point to the same location, which is the parent directory of bin and other directories. If you want to install multiple Tomcat instances but do not want to install multiple software backups, you can use these two properties. In the tomcat directory, only the bin and lib directories are shared by multiple tomcat instances. Other directories such as conf, logs, temp, webapps, and work are independent backups of each Tomcat instance. At this time they point to different locations: 3. Tomcat6 class loading mechanism Responsible for loading all classes and jar packages in the $CATALINA_HOME/common directory. For detailed configuration, refer to the common.loader configuration in the $CATALINA_HOME/conf/catalina.properties file. The classes loaded by this classloader are visible to the Server class loader and the Webapp class loader. The Commonclass loader is created when Tomcat starts, and its parent classloader is the System class loader. Responsible for loading Tomcat's core classes, all classes and jars in the $CATALINE_HOME/server directory, which can be specified by the server.loader configuration in catalina.propreties; it is created when Tomcat starts, and its parent loader is Commonclass loader; Responsible for loading common classes of webapp, which can be specified by the user through the shared.loader property in the catalina.properties file; it is created when Tomcat starts, and its parentloader is also the Common class loader; It is only responsible for loading classes under WEB-INF/classes and WEB-INF/lib in each app; although its parentloader is a Shared class loader, its loading strategy is different from the default class loading mechanism; The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to redirect to other pages in html page within two seconds
>>: Detailed explanation of Vue's props configuration
Table of contents 1. Use SVG 2. Use fontAwesome 3...
Application scenario: It is necessary to count th...
Preface Due to the needs of the company's bus...
Suggestion: Handwriting code as much as possible c...
1 Keep the rpm package downloaded when yum instal...
Problem Description After installing workstations...
Table of contents 1 System Introduction 2 System ...
To execute a shell command in Docker, you need to...
Sorting Problem I recently read "45 Lectures...
Table of contents Preface HTTP HTTP Server File S...
The question arises This question arose when I wa...
IP masquerading and port forwarding Firewalld sup...
Scenario A recent requirement is an h5 page for m...
Kernel: [root@opop ~]# cat /etc/centos-release Ce...
1. The table tag is table, tr is row, td is cell, ...