+

Search Tips   |   Advanced Search

Troubleshoot class loaders

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 administrative console class loader viewer to examine class loaders and the classes loaded by each class loader.

This topic assumes that we have installed an application on a server supported by the product and we 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 us to examine class loaders in a runtime environment.

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

Enable the service and restart the server.

The runtime environment of WebSphere Application Server 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

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:

Use the class loader viewer to examine class loaders and correct problems with application or class loader configurations.


Tasks


What to do next

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


Subtopics


Related:

  • Class loaders
  • Diagnose problems (using diagnosis tools)
  • Class loading
  • Configure web module class loaders
  • 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