Tomcat Class Loader; Jonas Class Loaders; Jonas Class Loader Hierarchy - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

56
Chapter 5. JOnAS Class Loader Hierarchy
5.4. Tools Class Loader
The tools class loader is a JOnAS-specific class loader that loads all classes for which applications
do not require visibility (that is, user applications will not be able to load the classes packaged in the
tools class loader). For example, it includes the jakarta velocity and digester components. This class
loader has the commons class loader as its parent class loader.

5.5. Tomcat Class Loader

The Tomcat class loader loads all classes of the Tomcat server (the
CATALINA_HOME/server/lib
directory). The classes of the common directory of Tomcat (
direc-
CATALINA_HOME/common/lib
tory) are loaded by the application class loader and not by this Tomcat class loader. Applications have
the visibility of the common classes and not the server classes. To have the visibility of the server
class, the context must have the privileged attribute set to true. This class loader has the application
class loader as its parent class loader.

5.6. JOnAS Class Loaders

The JOnAS class loader hierarchy that allows the deployment of EAR applications without placing
the EJB JAR in the
directory consists of the following:
WEB-INF/lib
5.6.1. EAR Class Loader
The EAR class loader is responsible for loading the EAR application. There is only one EAR class
loader per EAR application. This class loader is the child of the application class loader, thus making
it visible to the JOnAS classes.
5.6.2. EJB Class Loader
The EJB class loader is responsible for loading all the EJB JARs of the EAR application, thus all the
EJBs of the same EAR application are loaded with the same EJB classloader. This class loader is the
child of the EAR class loader.
5.6.3. WEB Class Loader
The WEB class loader is responsible for loading the Web components. There is one WEB class loader
per WAR file, and this class loader is the child of the EJB class loader. Using this class loader hierarchy
(the EJB class loader is the parent of the WEB class loader) eliminates the problem of visibility
between classes when a WEB component tries to reference EJBs; the classes loaded with the WEB
class loader are definitely visible to the classes loaded by its parent class loader (EJB class loader).
The compliance of the class loader of the web application to the Java 2 delegation model can be
changed by using the
file. This is described in Chapter 17 Defining the Web Deploy-
jonas-web.xml
ment Descriptor.
If the
element is set to
, the class loader of the web application
java2-delegation-model
false
looks for the class in its own repository before asking its parent class loader.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Application server

Table of Contents