Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 77938 invoked from network); 7 Nov 2001 13:58:11 -0000 Received: from unknown (HELO osaka.betaversion.org) (192.18.49.133) by daedalus.apache.org with SMTP; 7 Nov 2001 13:58:11 -0000 Received: (qmail 21528 invoked from network); 7 Nov 2001 14:00:37 -0000 Received: from nagoya.betaversion.org (192.18.49.131) by osaka.betaversion.org with SMTP; 7 Nov 2001 14:00:37 -0000 Received: (qmail 2044 invoked by uid 97); 7 Nov 2001 13:57:47 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 1916 invoked by uid 97); 7 Nov 2001 13:57:41 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 1712 invoked by uid 97); 7 Nov 2001 13:57:38 -0000 Date: 7 Nov 2001 13:46:02 -0000 Message-ID: <20011107134602.33117.qmail@icarus.apache.org> From: larryi@apache.org To: jakarta-tomcat-cvs@apache.org Subject: cvs commit: jakarta-tomcat/src/doc tomcat-ug.html X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N larryi 01/11/07 05:46:02 Modified: src/doc tomcat-ug.html Log: Update to cover the use of a "classes" directory under the lib/container, lib/common, and lib/apps directory. Revision Changes Path 1.21 +47 -22 jakarta-tomcat/src/doc/tomcat-ug.html Index: tomcat-ug.html =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/doc/tomcat-ug.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- tomcat-ug.html 2001/10/21 16:29:00 1.20 +++ tomcat-ug.html 2001/11/07 13:46:02 1.21 @@ -1,7 +1,7 @@ - + @@ -879,34 +879,59 @@

In this classloader hierarchy, classloaders can access classes in classloaders beneath them. They can not access classes in classloaders to the -side or above! With this in mind, a brief inspection should reveal that in -Tomcat 3.3, web applications, without some intervention, would not have access -to an XML parser by default. The crimson.jar and +side or above! To understand why this is important, consider whether web +applications would have access to an XML parser in this classloader hierarchy. +A brief inspection should reveal that in Tomcat 3.3, web applications would +not normally have access to an XML parser. The crimson.jar and xalan.jar are tucked away in the Server Classloader where -they are accessible only within that classloader. However, "intervention" -is provided by default. The default configuration for the -LoaderInterceptor11 is to -provide an XML parser to web applications that don't already contain one.

- -

Also note that if you have a jar containing classes that depend on +they are accessible only within that classloader. The same is true for the +other jars in Server Classloader are not visible to web applications +as well.

+ +

The primary benefit of this new classloader hierarchy is that you can put +your own XML parser in your web application without running into conflicts with +the XML parser being used by the server. However, since having an XML parser +by default has been the norm in the past, Tomcat 3.3 tries to maintain this +behavior should your web application not already contain an XML parser. The +default configuration for the +LoaderInterceptor11 in +server.xml is to provide an XML parser to web applications +that don't already contain one. It accomplishes this by adding entries to +the Webapp Classloader as if you had included the +crimson.jar and xalan.jar in your web application's +WEB-INF/lib.

+ +

Along with this classloader hierarchy comes the need to decide which +classloader is the appropriate one in which to add classes or jars. +Note that if you have a jar containing classes that depend on servlet.jar, putting that jar on the CLASSPATH wouldn't work. servlet.jar isn't accessible to the Application Classloader. -This is why in Tomcat 3.3, your CLASSPATH environment variable is ignored. You -must place such a jar in the Common Classloader or above.

+This is why in Tomcat 3.3, your CLASSPATH environment variable is ignored. The +appropriate classloader would be the Common Classloader or above.

Classes that are used in one particular web application should be placed in that web application's WEB-INF/classes or in a jar in the WEB-INF/lib as defined by the Servlet 2.2 specification. If you -want to give the classes wider scope, place the classes in a jar if they aren't -already. Then place the jar in the directory that corresponds to the -classloader with the scope you desire. In the Apps Classloader, the -classes are shared among all the web applications. In the Common Classloader, -the classes are shared among all the web applications and the web server.

- -

A second method is available for adding classes to the Common Classloader -and Apps Classloader. Entries found in an org.apache.tomcat.common.classpath -System property are added to the Common Classloader and entries found in -an org.apache.tomcat.apps.classpath are added to the Apps CLassloader.

+want to give the classes wider scope by putting them in the +Common Classloader or Apps Classloader, or want them +to be part of the Server Classloader, use one of the following two +methods to have those classes included in that classloader: + +
    +
  1. If the classes are in a jar file, place the jar file in the directory + that corresponds to the chosen classloader. If the classes exist as + class files, create a classes under the corresponding + directory if it doesn't already exist. Then add the class files into + the appropriate package directory under the classes + directory.
  2. +
  3. If the chosen classloader is the Common Classloader or + Apps classloader you include a directory or jar these + classloaders by listing them a System property. For the + Common Classloader, include the directory or jar file in a + System property named org.apache.tomcat.common.classpath. + For the Apps classloader, use a System property named + org.apache.tomcat.apps.classpath.
  4. +

Note: In an instance of Tomcat 3.3 which is using ReloadInterceptor (the default), -- To unsubscribe, e-mail: For additional commands, e-mail: