WAS v8.5 > Troubleshoot

Troubleshoot class loaders

Class loaders find and load class files for applications. To examine class loaders and the classes loaded by each class loader use the class loader viewer found in the dmgr console.

Before using, enable the class loader viewer service...

After enabling the service, restart the server.

WAS runtime uses the following class loaders, in the following order...

  1. Bootstrap, extensions, and CLASSPATH
  2. WebSphere extensions
  3. Application module
  4. Web module

Modules include .war and .jar files (Web modules and EJBs).

Class loaders generally delegate requests to the parent class loader, going up the precedence list until the class is found. If none of the parent class loaders can find the class, the original class loader attempts to load the class. Requests only go to parent class loaders, not child class loaders.

If the class loaders that load the application artifacts are mis-configured, the JVM throws class loading exceptions...


Examine a tree view that lists all installed applications and their modules

The modules can be .war files or EJB modules (.jar files).


Examine the class loader delegation hierarchy

Select a module to access the Class loader viewer page. The page lists the class loaders visible to web (.war) and EJB (.jar) modules.

Delegation hierarchy is determined by the class loader delegation mode specified within an application or web module....


Export information on class loaders

  1. On the Class loader viewer page, click Export.

  2. Select to open a browser or editor on the class loader information or to save the information to disk in XML format.

  3. Click OK, and specify any additional information requested by the system.


Display information about class loaders visible to the module in an HTML table format

On the Class loader viewer page, click Table View.

Class loader Description
Delegation Whether the class loader delegates the loading of the module to its parent class loader. A value of true implies the class loader of the parent application is being used (Classes loaded with parent class loader first). A value of false implies the module class loader is being used (Classes loaded with local class loader first (parent last)).
Classpath Lists the paths over which the class loader searches for classes and resources.
Classes Lists the names of classes loaded in the JVM by this class loader.

The Table View option does not return a value when out-of-memory errors are generated. The out-of-memory errors might be related to a memory leak. To examine information about class loaders in a table, resolve the out-of-memory problem, and then click Table View again.


Search class loaders

On the Class loader viewer page, click Search to access the Search page, on which we can search class loaders for the following:

The search is case-sensitive. Class loading exceptions describes several uses of the Search page.


Configure class loaders

We can configure class loaders for the following:

Class loader configuration determines which class loader loads the classes and resource files for an application or web module. Application and WAR module class loader configuration settings include Class loader order and WAR class loader policy.

A Class loader order value can be either...

The default is Classes loaded with parent class loader first. The class loader delegates loading a class or resource to its immediate parent class loader before searching its classpath.

When troubleshooting class loading problems, we might need to override classes visible to a parent class loader. To override such classes with those specific to an application, set the Class loader order to...

...on the class loader containing the application classes on its classpath. An application can override classes visible to a parent class loader, but doing so can result in a ClassCastException or UnsatisfiedLinkError if there is a mixed use of overridden classes and non-overridden classes.

For example, under default class loader policies, a web module has its own Web module (WAR) class loader to load its artifacts, which are typically in the directories...

An application module class loader is the immediate parent of this WAR class loader. To ensure the web module class loader searches these paths for a particular class or resource first, before delegating the load operation to the application module class loader, set the Class loader order of the web module to...


See


Related

Class loaders
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


+

Search Tips   |   Advanced Search