Troubleshoot class loaders

 

+

Search Tips   |   Advanced Search

 

 

Class loaders find and load class files. For a deployed application to run properly, the class loaders that affect the application and its modules must be configured so that the application can find the files and resources that it needs. Diagnosing problems with class loaders can be complicated and time-consuming. To diagnose and fix the problems more quickly, use the console Class Loader Viewer to examine class loaders and the classes loaded by each class loader.

This topic assumes that you have installed an application on a server supported by WAS and you want to examine class loaders used by the application or its modules. The modules can be Web modules (.war files) or enterprise bean (EJB) modules (.jar files). The Class Loader Viewer enables you to examine class loaders in a runtime environment.

This topic also assumes that you have enabled the class loader viewer service. Click...

Servers | Application servers | server_name | Class Loader Viewer Service

Enable the service and restart the server.

 

Overview

The runtime environment of WAS uses the following class loaders to find and load new classes for an application in the following order:

  1. The bootstrap, extensions, and CLASSPATH class loaders created by the Java virtual machine

  2. A WebSphere extensions class loader

  3. One or more application module class loaders that load elements of enterprise applications running in the server

  4. Zero or more Web module class loaders

Class loader hierarchy

Each class loader is a child of the previous class loader. That is, the application module class loaders are children of the WebSphere extensions class loader, which is a child of the CLASSPATH Java class loader. Whenever a class needs to be loaded, the class loader usually delegates the request to its parent class loader. If none of the parent class loaders can find the class, the original class loader attempts to load the class. Requests can only go to a parent class loader; they cannot go to a child class loader. After a class is loaded by a class loader, any new classes that it tries to load reuse the same class loader or go up the precedence list until the class is found.

If the class loaders that load the artifacts of an application are not configured properly, the JVM might throw a class loading exception when starting or running that application. Class loading exceptions describes the types of exceptions caused by improperly configured class loaders and suggests ways to use the Class Loader Viewer to correct configurations of class loaders. The types of exceptions include:

The steps that follow describe generally how to use the Class Loader Viewer to examine class loaders and correct problems with application or class loader configurations.

 

Procedure

 

What to do next

If you continue to have class loader problems, refer to Class loading exceptions and to Class loading.



Class loading exceptions

Class loader viewer service settings

Enterprise application topology

Class loader viewer settings

Search settings

 

Related concepts


Class loaders

 

Related tasks


Class loading
Configure Web module class loaders
Diagnosing problems (using diagnosis tools)

 

Related information


Demystifying class loading problems, Part 1: An introduction to class loading and debugging tools
Demystifying class loading problems, Part 2: Basic class loading exceptions
Demystifying class loading problems, Part 3: Tackling more unusual class loading problems