Requirements for in-memory stateful failover  Deciding which classes to add to the custom list

Chapter 30: Configuring Custom Java Class Lists

Understanding how the class loader works

In Java, a class loader loads the Java classes used by an application. Most applications use the Java system class loader, which loads classes from the directories and JAR files specified by the CLASSPATH environment variable. In the normal Java program configuration, you must restart a program or server to begin using updated Java classes. EAServer uses customized Java class loaders to allow hot refresh of Web application classes and Java components without restarting the server. EAServer provides custom class loaders for these entity types:

Class loader versions

EAServer supports two class loader versions. EAServer releases earlier than 5.1 use class loader version 1.0. Beginning in EAServer 5.1, you can configure two versions

You can configure the class loader version in the EAServer Manager Server Properties dialog box, on the Java VM tab; select Use Jaguar Class Loader Version 2 to begin using the version 2 class loader. If using jagtool or an EAServer configuration file, set the server property

The class loader hierarchy and delegation policy

Each server, component, Web application, application, and package has a custom class loader associated with it. The EAServer class loaders have a a parent-child hierarchy. Every class loader except the server class loader has a parent. This relationship is shown in the following figure:

Figure 30-1: EAServer class loader hierarchy

When you specify the same class at multiple levels, the class loader delegation policy determines how version conflicts are resolved. The version 2 class loader supports these settings:

NoteIf you use the version 1 class loader, the delegation policy is always Parent First, regardless of the entity configuration.

You can configure the delegation policy for each component, package, Web application, application. In EAServer Manager, use the Class Loader Policy control on the Java Classes tab in the properties dialog for the entity. If using jagtool or an EAServer configuration file, set the property listed in the Table 30-1.

Table 30-1: Class loader delegation properties


Property name



Web application


The system class loader

Classes not loaded by the custom class loader must be loaded by the system class loader, based on the search order specified by the server class path setting. These classes cannot be refreshed without restarting the server. It can be more efficient configure system class loaders for classes that are used server wide, as long as all components that use them require the same class versions, and you do not need to refresh the classes without restarting the server. (For classes used server-wide that may be updated, you can configure sharing of the classes at the server class loader level, as described in “Custom class lists for packages, applications, or servers”.)

By default, the server class path includes these entries:

You can add classes or JAR files to the server’s class path using any of these techniques:

Copyright © 2005. Sybase Inc. All rights reserved. Deciding which classes to add to the custom list