In-depth understanding of Java Virtual Machines Learning Notes 8--tomcat class loader architecture

Source: Internet
Author: User
Tags tomcat server

Major web servers such as Tomcat implement more than one custom ClassLoader for the following basic functions:

(1). The Java class libraries used by two Web applications deployed on the same server can be isolated from one another.

(2). The Java class libraries that are used by two Web applications deployed on the same server can be shared with one another.

(3). Many Web servers themselves are implemented in the Java language, so the class library used by the server should be independent of the application's class library.

(4). The Web server that supports the JSP application needs to support the HotSwap function, because the JSP file is ultimately run by a servlet compiled as Java, and when the JSP file is modified, it is not necessary to restart the server for a hot deployment.

The TOMCAT5 and TOMCAT6 class loading architectures are distinguished by the use of Tomcat as the representative of the JDK-recommended parental delegation model implementation of the Orthodox class loader:

TOMCAT5:

The directories in TOMCAT5 that can hold Java class libraries and Web applications are as follows:

(1)./common Directory: The class library can be used by both the Tomcat server itself and all Web applications.

(2)./server Directory: The class library can be used by the Tomcat server itself and is not visible to the application.

(3)./shared Directory: The class library can be used by all applications and is not visible to the Tomcat server itself.

(4)./webapp/web-inf Directory: Class libraries can only be used by applications and are not visible to other applications and Tomcat servers.

The class loading architecture for TOMCAT5 is as follows:

TOMCAT6:

Tomcat defaults to merging the/common,/server, and/shared three directories into a single/lib directory, so TOMCAT6 can store the Java class Library and the Web App directory as follows:

(1)./lib Directory: The class library can be used by both the Tomcat server itself and all Web applications.

(2)./webapp/web-inf directory: Class libraries can only be used by applications and are not visible to other applications and Tomcat servers.

The default class loading architecture for TOMCAT6 is as follows:

In Tomcat6, you can install the directory by specifying <tomcat >/conf/ The Server.loader and Share.loader in the Catalina.properties properties file establish and Tomcat5 similar serverclassloader and Sharedclassloader.

(go) Deep understanding Java Virtual Machine Learning Note 8--tomcat class loader architecture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.