Tomcat Custom Classpath

Source: Internet
Author: User

Since the use of Tomcat and WebLogic as the main application server, recently encountered a problem in the process of upgrading new middleware, our web front-end applications are now upgraded to a full-scale package upgrade, because the current system architecture for the front and back end through the RPC framework interaction, The backend is managed using Java Service Wrapper, and its organizational structure allows us to set the Lib directory in the configuration file (in fact, as early as three months ago, I do not want to use it very much), We manage the three-way library and the company's Framework class library and the Application class library in separate directories, so that only the application jar package can be upgraded, and the framework and application can be independently decoupled from the management.

Because the front-end is to provide a view layer, it is still using Tomcat, but in Tomcat 6 and later versions, and 5.5 and earlier versions, its ClassLoader architecture has changed, removing the original shared loader as follows:

5.5 Architecture

Https://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

6.0 after Architecture:

Https://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

Note: Https://www.mulesoft.com/tcat/tomcat-classpath and http://blog.csdn.net/andyelvis/article/details/ 6719996, there is a reference to 5.5 as well as the previous version, 6.0 beginning with no update mentioned.

As you can see, there is no shared class loader. Although there are shares.folder parameters in Catalina.properties, this parameter is tested and has no effect.

#
#
# List of comma-separated paths defining the contents of the "common"
# ClassLoader. Prefixes should was used to define, what's the repository type.
# path is relative to the Catalina_home or catalina_base path or absolute.
# If left as blank,the JVM system loader would be used as Catalina ' s "common"
# loader.
# Examples:
# "Foo": Add this folder as a class repository
# "Foo/*.jar": Add all the JARs of the specified folder as Class
# repositories
# "Foo/bar.jar": Add Bar.jar as a class repository
Common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar

# List of comma-separated paths defining the contents of the "GKFX"
# ClassLoader. Prefixes should was used to define, what's the repository type.
# path is relative to the catalina_base Path or absolute. If left as Blank,
# the "common" loader would be used as Catalina ' s "shared" loader.
# Examples:
# "Foo": Add this folder as a class repository
# "Foo/*.jar": Add all the JARs of the specified folder as Class
# repositories
# "Foo/bar.jar": Add Bar.jar as a class repository
# jars, e.g Bar.jar, you need the URL form
# Starting with file:.
shared.loader=${catalina.home}/shared/lib,${catalina.home}/shared/lib/*.jar,${catalina.base}/shared/lib,${ Catalina.base}/shared/lib/*.jar

The jar above is not loaded into the app.

It now seems that if you have to refer to a jar in a non-standard directory, you can only add it to tomcat/lib in a way that resolves it.

Tomcat Custom Classpath

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.