Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
771 blopes 1
<!DOCTYPE html SYSTEM "about:legacy-compat">
2
<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><link href="../images/docs-stylesheet.css" rel="stylesheet" type="text/css"><title>Apache Tomcat 9 Configuration Reference (9.0.112) - The Loader Component</title></head><body><div id="wrapper"><header><div id="header"><div><div><div class="logo noPrint"><a href="https://tomcat.apache.org/"><img alt="Tomcat Home" src="../images/tomcat.png"></a></div><div style="height: 1px;"></div><div class="asfLogo noPrint"><a href="https://www.apache.org/" target="_blank"><img src="../images/asf-logo.svg" alt="The Apache Software Foundation" style="width: 266px; height: 83px;"></a></div><h1>Apache Tomcat 9 Configuration Reference</h1><div class="versionInfo">
3
            Version 9.0.112,
4
            <time datetime="2025-11-06">Nov 6 2025</time></div><div style="height: 1px;"></div><div style="clear: left;"></div></div></div></div></header><div id="middle"><div><div id="mainLeft" class="noprint"><div><nav><div><h2>Links</h2><ul><li><a href="../index.html">Docs Home</a></li><li><a href="index.html">Config Ref. Home</a></li><li><a href="https://cwiki.apache.org/confluence/display/TOMCAT/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul></div><div><h2>Top Level Elements</h2><ul><li><a href="server.html">Server</a></li><li><a href="service.html">Service</a></li></ul></div><div><h2>Executors</h2><ul><li><a href="executor.html">Executor</a></li></ul></div><div><h2>Connectors</h2><ul><li><a href="http.html">HTTP/1.1</a></li><li><a href="http2.html">HTTP/2</a></li><li><a href="ajp.html">AJP</a></li></ul></div><div><h2>Containers</h2><ul><li><a href="context.html">Context</a></li><li><a href="engine.html">Engine</a></li><li><a href="host.html">Host</a></li><li><a href="cluster.html">Cluster</a></li></ul></div><div><h2>Nested Components</h2><ul><li><a href="cookie-processor.html">CookieProcessor</a></li><li><a href="credentialhandler.html">CredentialHandler</a></li><li><a href="globalresources.html">Global Resources</a></li><li><a href="jar-scanner.html">JarScanner</a></li><li><a href="jar-scan-filter.html">JarScanFilter</a></li><li><a href="listeners.html">Listeners</a></li><li><a href="loader.html">Loader</a></li><li><a href="manager.html">Manager</a></li><li><a href="realm.html">Realm</a></li><li><a href="resources.html">Resources</a></li><li><a href="sessionidgenerator.html">SessionIdGenerator</a></li><li><a href="valve.html">Valve</a></li></ul></div><div><h2>Cluster Elements</h2><ul><li><a href="cluster.html">Cluster</a></li><li><a href="cluster-manager.html">Manager</a></li><li><a href="cluster-channel.html">Channel</a></li><li><a href="cluster-membership.html">Channel/Membership</a></li><li><a href="cluster-sender.html">Channel/Sender</a></li><li><a href="cluster-receiver.html">Channel/Receiver</a></li><li><a href="cluster-interceptor.html">Channel/Interceptor</a></li><li><a href="cluster-valve.html">Valve</a></li><li><a href="cluster-deployer.html">Deployer</a></li><li><a href="cluster-listener.html">ClusterListener</a></li></ul></div><div><h2>web.xml</h2><ul><li><a href="filter.html">Filter</a></li></ul></div><div><h2>Other</h2><ul><li><a href="runtime-attributes.html">Runtime attributes</a></li><li><a href="systemprops.html">System properties</a></li><li><a href="jaspic.html">JASPIC</a></li></ul></div></nav></div></div><div id="mainRight"><div id="content"><h2>The Loader Component</h2><h3 id="Table_of_Contents">Table of Contents</h3><div class="text">
5
<ul><li><a href="#Introduction">Introduction</a></li><li><a href="#Attributes">Attributes</a><ol><li><a href="#Common_Attributes">Common Attributes</a></li><li><a href="#Standard_Implementation">Standard Implementation</a></li></ol></li><li><a href="#Nested_Components">Nested Components</a></li><li><a href="#Special_Features">Special Features</a><ol><li><a href="#Logging">Logging</a></li></ol></li></ul>
6
</div><h3 id="Introduction">Introduction</h3><div class="text">
7
 
8
  <p>The <strong>Loader</strong> element represents the <em>web
9
  application class loader</em> that will be used to load Java
10
  classes and resources for your web application.  Such
11
  a class loader must follow the requirements of the Servlet
12
  Specification, and load classes from the following locations:</p>
13
  <ul>
14
  <li>From the <code>/WEB-INF/classes</code> directory inside your
15
      web application.</li>
16
  <li>From JAR files in the <code>/WEB-INF/lib</code> directory
17
      inside your web application.</li>
18
  <li>From resources made available by Catalina to all web
19
      applications globally.</li>
20
  </ul>
21
 
22
  <p>A Loader element MAY be nested inside a <a href="context.html">Context</a>
23
  component.  If it is not included, a default Loader configuration will be
24
  created automatically, which is sufficient for most requirements.</p>
25
 
26
  <p>For a more in-depth description of the class loader hierarchy
27
  that is implemented by Catalina, see <a href="../class-loader-howto.html">the ClassLoader HowTo</a>.</p>
28
 
29
    <p><em>The description below uses the variable name $CATALINA_BASE to refer the
30
    base directory against which most relative paths are resolved. If you have
31
    not configured Tomcat for multiple instances by setting a CATALINA_BASE
32
    directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME,
33
    the directory into which you have installed Tomcat.</em></p>
34
 
35
</div><h3 id="Attributes">Attributes</h3><div class="text">
36
 
37
  <div class="subsection"><h4 id="Common_Attributes">Common Attributes</h4><div class="text">
38
 
39
    <p>All implementations of <strong>Loader</strong>
40
    support the following attributes:</p>
41
 
42
    <table class="defaultTable"><tr><th style="width: 15%;">
43
          Attribute
44
        </th><th style="width: 85%;">
45
          Description
46
        </th></tr><tr id="Attributes_Common Attributes_className"><td><code class="attributeName">className</code></td><td>
47
        <p>Java class name of the implementation to use.  This class must
48
        implement the <code>org.apache.catalina.Loader</code> interface.
49
        If not specified, the standard value (defined below) will be used.</p>
50
      </td></tr><tr id="Attributes_Common Attributes_delegate"><td><code class="attributeName">delegate</code></td><td>
51
        <p>Set to <code>true</code> if you want the class loader to follow
52
        the standard Java2 delegation model, and attempt to load classes from
53
        parent class loaders <strong>before</strong> looking inside the web
54
        application.  Set to <code>false</code> (the default) to have the
55
        class loader look inside the web application first, before asking
56
        parent class loaders to find requested classes or resources.</p>
57
      </td></tr><tr id="Attributes_Common Attributes_reloadable"><td><code class="attributeName">reloadable</code></td><td>
58
        <p><strong>NOTE</strong> - This attribute has been deprecated in Tomcat
59
        9 and will be removed in Tomcat 10. Use the equivalent attribute on the
60
        surrounding <a href="context.html">Context</a> component.</p>
61
 
62
        <p>Set to <code>true</code> if you want Catalina to monitor classes in
63
        <code>/WEB-INF/classes/</code> and <code>/WEB-INF/lib</code> for
64
        changes, and automatically reload the web application if a change
65
        is detected.  This feature is very useful during application
66
        development, but it requires significant runtime overhead and is
67
        not recommended for use on deployed production applications.  You
68
        can use the <a href="../manager-howto.html">Manager</a> web
69
        application, however, to trigger reloads of deployed applications
70
        on demand.</p>
71
 
72
        <p><strong>NOTE</strong> - The value for this property will be
73
        inherited from the <code>reloadable</code> attribute you set on
74
        the surrounding <a href="context.html">Context</a> component,
75
        and any value you explicitly set here will be replaced.</p>
76
      </td></tr></table>
77
 
78
  </div></div>
79
 
80
 
81
  <div class="subsection"><h4 id="Standard_Implementation">Standard Implementation</h4><div class="text">
82
 
83
    <p>The standard implementation of <strong>Loader</strong> is
84
    <strong>org.apache.catalina.loader.WebappLoader</strong>.
85
    It supports the following additional attributes (in addition to the
86
    common attributes listed above):</p>
87
 
88
    <table class="defaultTable"><tr><th style="width: 15%;">
89
          Attribute
90
        </th><th style="width: 85%;">
91
          Description
92
        </th></tr><tr id="Attributes_Standard Implementation_loaderClass"><td><code class="attributeName">loaderClass</code></td><td>
93
        <p>Java class name of the <code>java.lang.ClassLoader</code>
94
        implementation class to use. Custom implementations must extend
95
        <code>org.apache.catalina.loader.WebappClassLoaderBase</code>.
96
        </p>
97
 
98
        <p>If not specified, the default value is
99
        <code>org.apache.catalina.loader.ParallelWebappClassLoader</code>. The
100
        default <strong>loaderClass</strong> is parallel capable, which
101
        means that multiple threads may load difference classes in parallel.
102
        A non-parallel capable <strong>loaderClass</strong> is available and can
103
        be used by specifying
104
        <code>org.apache.catalina.loader.WebappClassLoader</code>.</p>
105
      </td></tr></table>
106
 
107
  </div></div>
108
 
109
</div><h3 id="Nested_Components">Nested Components</h3><div class="text">
110
 
111
  <p>No components may be nested inside a <strong>Loader</strong> element.</p>
112
 
113
</div><h3 id="Special_Features">Special Features</h3><div class="text">
114
 
115
  <div class="subsection"><h4 id="Logging">Logging</h4><div class="text">
116
 
117
    <p>A loader is associated with the log category based on its classname.</p>
118
 
119
  </div></div>
120
 
121
</div></div></div></div></div><footer><div id="footer">
122
    Copyright &copy; 1999-2025, The Apache Software Foundation
123
    <br>
124
    Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo
125
    are either registered trademarks or trademarks of the Apache Software
126
    Foundation.
127
    </div></footer></div></body></html>