You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@apache.org on 2001/10/04 00:00:41 UTC

cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs class-loader-howto.xml

craigmcc    01/10/03 15:00:41

  Modified:    webapps/tomcat-docs class-loader-howto.xml
  Log:
  Update the Class Loader doc for the HEAD branch to reflect the revised
  state of the world.
  
  Revision  Changes    Path
  1.2       +36 -93    jakarta-tomcat-4.0/webapps/tomcat-docs/class-loader-howto.xml
  
  Index: class-loader-howto.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/class-loader-howto.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- class-loader-howto.xml	2001/09/04 04:39:04	1.1
  +++ class-loader-howto.xml	2001/10/03 22:00:41	1.2
  @@ -8,7 +8,7 @@
   
       <properties>
           <author email="craigmcc@apache.org">Craig R. McClanahan</author>
  -        <title>Class Loader INFO</title>
  +        <title>Class Loader HOW-TO</title>
       </properties>
   
   <body>
  @@ -27,15 +27,11 @@
       application archive.</li>
   <li>For classes and resources that must be shared across all web applications,
       place unpacked classes and resources under
  -    <code>$CATALINA_HOME/classes</code>, or place JAR files containing those
  -    classes and resources under <code>$CATALINA_HOME/lib</code>.</li>
  +    <code>$CATALINA_HOME/shared/classes</code>, or place JAR files
  +    containing those classes and resources under
  +    <code>$CATALINA_HOME/shared/lib</code>.</li>
   </ul>
   
  -<p><strong>WARNING</strong> - Unlike Tomcat 3.x, Tomcat 4 does
  -<strong>NOT</strong> make an XML parser visible to web applications by default.
  -If you need to do this, see <a href="#Tomcat 4 and XML Parsers">Tomcat 4 and
  -XML Parsers</a>, below.</p>
  -
   </section>
   
   
  @@ -70,8 +66,6 @@
    Catalina   Shared
                /   \
           Webapp1  Webapp2 ... 
  -          /         /
  -       Jasper1  Jasper2 ...
   </source>
   
   <p>The characteristics of each of these class loaders, including the source
  @@ -118,13 +112,16 @@
       <li><em>jndi.jar</em> - The Java Naming and Directory Interface API
           classes (loaded <strong>ONLY</strong> on a JDK 1.2 system, because they
           are included automatically on JDK 1.3 and later).</li>
  -    <li><em>naming.jar</em> - The JNDI implementation used by Tomcat 4 to
  -        represent the default JNDI naming context provided to web
  -        applications.</li>
  -    <li><em>resources.jar</em> - Resource factory classes for the JNDI naming
  -        context that is used internally to represent the static resources of
  -        a web application.</li>
  +    <li><em>naming-common.jar</em> - The JNDI implementation used by Tomcat 4
  +        to represent in-memory naming contexts.</li>
  +    <li><em>naming-resources.jar</em> - The specialized JNDI naming context
  +        implementation used to represent the static resources of a web
  +        application.</li>
       <li><em>servlet.jar</em> - The Servlet and JSP API classes.</li>
  +    <li><em>xerces.jar</em> - The XML parser that is visible by default to
  +        Tomcat internal classes and to web applications.  This can be
  +        overridden, for a particular web application, by including your
  +        desired parser in <code>/WEB-INF/lib</code>.</li>
       </ul></li>
   <li><strong>Catalina</strong> - This class loader is initialized to include
       all classes and resources required to implement Tomcat 4 itself.  These
  @@ -137,34 +134,41 @@
       <ul>
       <li><em>catalina.jar</em> - Implementation of the Catalina servlet
           container portion of Tomcat 4.</li>
  -    <li><em>crimson.jar</em> - Parser portion of the JAXP/1.1 reference
  -        implementation, used to parse web application deployment descriptor
  -        (<code>web.xml</code>) files, as well as the server configuration file
  -        (<code>$CATALINA_HOME/conf/server.xml</code>).</li>
       <li><em>jakarta-regexp-X.Y.jar</em> - The binary distribution of the
           <a href="http://jakarta.apache.org/regexp/">Jakarta Regexp</a>
           regular expression processing library, used in the implementation of
           request filters.</li>
  -    <li><em>jaxp.jar</em> - JAXP API portion of the JAXP/1.1 reference
  -        implementation, used to parse web application deployment descriptor
  -        (<code>web.xml</code>) files, as well as the server configuration file
  -        (<code>$CATALINA_HOME/conf/server.xml</code>).</li>
  +    <li><em>servlets-xxxxx.jar</em> - The classes associated with each
  +        internal servlet that provides part of Tomcat's functionality.
  +        These are separated so that they can be completely removed if the
  +        corresponding service is not required, or they can be subject to
  +        specialized security manager permissions.</li>
  +    <li><em>tomcat-ajp.jar</em> - Classes for the Java portion of the
  +        <code>mod_jk</code> web server connector, which allows Tomcat to
  +        run behind web servers such as Apache and iPlanet iAS and iWS.</li>
  +    <li><em>tomcat-util.jar</em> - Utility classes required by
  +        <em>tomcat-ajp.jar</em>.</li>
       <li><em>warp.jar</em> - Classes for the Java portion of the
           <code>mod_webapp</code> web server connector, which allows Tomcat to
           run behind web servers such as Apache and iPlanet iAS and iWS.</li>
       </ul></li>
   <li><strong>Shared</strong> - This class loader is the place to put classes
       and resources that you wish to share across <strong>ALL</strong>
  -    web applications (unless Tomcat internal classes also need access, which
  -    is an unusual case).  All unpacked classes and resources in
  -    <code>$CATALINA_HOME/classes</code>, as well as classes and resources
  -    in JAR files under <code>$CATALINA_HOME/lib</code>, are made visible
  -    through this class loader.  By default, that includes the following:
  +    web applications (unless Tomcat internal classes also need access,
  +    in which case you should put them in the <strong>Common</strong>
  +    class loader instead).  All unpacked classes and resources in
  +    <code>$CATALINA_HOME/shared/classes</code>, as well as classes and
  +    resources in JAR files under <code>$CATALINA_HOME/lib</code>, are
  +    made visible through this class loader.  By default, that includes
  +    the following:
       <ul>
  +    <li><em>jasper-compiler.jar</em> - The page compiler classes required
  +        to convert JSP source pages into executable servlets and compile
  +        them.</li>
       <li><em>jasper-runtime.jar</em> - The runtime support classes required
           to execute JSP pages that have already been translated into Java
           servlets and then compiled.</li>
  -    <li><em>namingfactory.jar</em> - JNDI object factories for resources
  +    <li><em>naming-factory.jar</em> - JNDI object factories for resources
           supported by the default JNDI naming context provided to web
           applications.</li>
       </ul></li>
  @@ -175,14 +179,6 @@
       under the <code>/WEB-INF/lib</code> directory of your web application
       archive, are made visible to the containing web application, but to
       no others.</li>
  -<li><strong>JasperX</strong> - If your web application uses JSP pages, Tomcat
  -    also creates an additional class loader for the web application,
  -    containing the JSP compiler and classes it depends on.  It is initialized
  -    to include all JAR files found in <code>$CATALINA_HOME/jasper</code>.
  -    Because this is a child class loader of the web application class loader,
  -    the Jasper compiler (and the pages that it compiles) can see all of the
  -    application bean classes visible in the <code>Webapp</code> class loader.
  -    </li>
   </ul>
   
   <p>As mentioned above, the web application class loader diverges from the
  @@ -202,62 +198,9 @@
   <li>System class loader classses (described above)</li>
   <li><em>$CATALINA_HOME/common/classes</em></li>
   <li><em>$CATALINA_HOME/common/*.jar</em></li>
  -<li><em>$CATALINA_HOME/classes</em></li>
  -<li><em>$CATALINA_HOME/lib/*.jar</em></li>
  +<li><em>$CATALINA_HOME/shared/classes</em></li>
  +<li><em>$CATALINA_HOME/shared/lib/*.jar</em></li>
   </ul>
  -
  -</section>
  -
  -
  -<section name="Tomcat 4 and XML Parsers">
  -
  -<p>Tomcat 4 itself utilizes XML parsing for three processing activities:</p>
  -<ul>
  -<li>Parsing the <code>server.xml</code> configuration file</li>
  -<li>Parsing <code>web.xml</code> deployment descriptors</li>
  -<li>Parsing JSP pages in XML syntax</li>
  -</ul>
  -
  -<p>By default, the Java API for XML Processing (Version 1.1) reference
  -implementation is utilized for all of these purposes.  However, this parser
  -is <strong>not</strong> visible to web applications -- instead, the XML
  -parser stored in <code>$CATALINA_HOME/server/lib</code> is used for parsing
  -<code>web.xml</code> and <code>server.xml</code> files, while the parser
  -stored in <code>$CATALINA_HOME/jasper</code> is used for parsing JSP pages
  -in XML syntax.</p>
  -
  -<p>To make an XML parser available to your web applications, you have several
  -options:</p>
  -<ul>
  -<li>To utilize an XML parser in a single web application, simply include the
  -    parser's JAR files in the <code>/WEB-INF/web.xml</code> directory of that
  -    web application.  This will work, no matter what parser might be used by
  -    Tomcat 4 internally, or by other web applications running in the same
  -    instance of Tomcat 4.</li>
  -<li>If you wish to make the JAXP/1.1 reference implementation parser available
  -    to all web applications, simply move the "jaxp.jar" and "crimson.jar" files
  -    from the <code>$CATALINA_HOME/jasper</code> directory into the
  -    <code>$CATALINA_HOME/lib</code> directory.  Jasper will continue to use
  -    this parser for processing JSP pages in XML syntax.</li>
  -<li>If you wish to make another XML parser that is JAXP/1.1 compatible
  -    (such as Xerces 1.3.1 or later), install that parser's JAR files into the
  -    <code>$CATALINA_HOME/lib</code> directory, and remove "jaxp.jar" and
  -    "crimson.jar" from the <code>$CATALINA_HOME/jasper</code> directory.
  -    Jasper will then utilize the new XML parser as well.</li>
  -</ul>
  -
  -<p><strong>WARNING</strong> - Do not attempt to use a JAXP/1.0 (rather than
  -JAXP/1.1) compliant parser with Tomcat 4.  Tomcat relies on the extra features
  -that were added in JAXP/1.1 to perform its parsing activities.</p>
  -
  -<p><strong>WARNING</strong> - The final release of the JAXP/1.1 reference
  -implementation includes JAR files with the <code>sealed</code> attribute.
  -This causes class loading problems (most commonly visible through "package
  -sealing violation" exceptions) on JDK 1.3 and later platforms.  To avoid
  -these problems, <em>modified</em> versions of "jaxp.jar" and "crimson.jar"
  -are shipped with Tomcat 4.  You must <strong>NOT</strong> replace these files
  -with standard JAXP/1.1 JAR files, until a subsequent JAXP release occurs that
  -has the "sealed" attribute removed.</p>
   
   </section>