Return-Path:
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 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 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
+ 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
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.Server Classloader
are not visible to web applications
+as well.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
.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.
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.
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:
+
+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.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
.Note: In an instance of Tomcat 3.3 which is using
ReloadInterceptor (the default),
--
To unsubscribe, e-mail: