Configure class loaders of a server

One can configure the application class loaders for an application server. Class loaders enable applications that are deployed on the application server to access repositories of available classes and resources.

 

Before you begin

This article assumes that an administrator created an application server on a WAS product.

 

Overview

Configure the class loaders of an application server to set class-loader policy and mode values which affect all applications that are deployed on the server. Use the administrative console to configure the class loaders.

 

Procedure

  1. Click...

    Servers | Application Servers | servername...

    ...to access the settings page for an application server.

  2. Specify the application class-loader policy for the application server. The application class-loader policy controls the isolation of applications that run in the system (on the server). An application class loader groups EJB modules, shared libraries, resource adapter archives (RAR files), and dependency JAR files associated to an application. Dependency JAR files are JAR files that contain code which can be used by both enterprise beans and servlets. The application class-loader policy controls whether an application class loader can be shared by multiple applications or is unique for each application. Use the settings page for the application server to specify the application class-loader policy for the server:

    OptionDescription
    SingleApplications are not isolated from each other. Uses a single application class loader to load all of the EJB modules, shared libraries, and dependency JAR files in the system.
    MultipleApplications are isolated from each other. Gives each application its own class loader to load the EJB modules, shared libraries, and dependency JAR files of that application.

  3. Specify the application class-loader mode for the application server. The application class loading mode specifies the class-loader mode when the application class-loader policy is Single. On the settings page for the application server, select either of the following values:

    OptionDescription
    Parent firstCauses the class loader to delegate the loading of classes to its parent class loader before attempting to load the class from its local class path. Parent first is the default value for class loading mode.
    Parent lastCauses the class loader to attempt to load classes from its local class path before delegating the class loading to its parent. Using this policy, an application class loader can override and provide its own version of a class that exists in the parent class loader.

  4. Specify the class-loader mode for the class loader.

    1. On the settings page for the application server, click Java and Process Management > Class loader to access the Class loader page.

    2. On the Class loader page, click New to access the settings page for a class loader.

    3. On the settings page for a class loader, specify the class-loader mode. The Parent First value causes the class loader to delegate the loading of classes to its parent class loader before attempting to load the class from its local class path. The Parent Last value causes the class loader to attempt to load classes from its local class path before delegating the class loading to its parent.

    4. Click OK.

    An identifier is assigned to a class-loader instance. The instance is added to the collection of class loaders shown on the Class loader page.

 

What to do next

Save the changes to the administrative configuration.


 

See Also


Class loaders
Shared library files

 

Related Tasks


Class loading

 

See Also


Class loader collection