WAS v8.5 > Develop applications > Class loading

Configure application class loaders

We can set values that control the class-loading behavior of an installed enterprise application. Class loaders enable an application to access repositories of available classes and resources.

Configure the class loaders of an enterprise application to set class-loader policy and mode values for this application.

An application class loader groups EJB modules, shared libraries, resource adapter archive (RAR) files, and dependency JAR files associated to an application. Dependency JAR files are JAR files containing code which can be used by both enterprise beans and servlets.

An application class loader is the parent of a web application archive (WAR) class loader. By default, a web module has its own WAR class loader to load the contents of the web module. The WAR class-loader policy value of an application class loader determines whether the WAR class loader or the application class loader is used to load the contents of the Web module.

Use the dmgr console to configure the class loaders.

If an application is running, changing an application setting causes the application to restart. On stand-alone servers, the application restarts after you save the change. On multiple-server products, the application restarts after you save the change and files synchronize on the node where the application is installed.

To control when synchronization occurs on multiple-server products, deselect Synchronize changes with nodes on the Console preferences page.

  1. Access the settings page for an application class loader.

      Applications | Application Types | WebSphere enterprise applications | application_name | Class loading and update detection

  2. Specify whether to reload application classes when the application or its files are updated.

    By default, class reloading is not enabled. To choose to reload application classes, select...

      Override class reloading settings for web and EJB modules

    You might specify different values for EJB modules and for web modules such as servlets and JSP files.

  3. Specify the number of seconds to scan the application's file system for updated files.

    The value specified for Polling interval for updated files takes effect only if class reloading is enabled. The default is the value of the reloading interval attribute in the IBM extension...

      META-INF/ibm-application-ext.xmi

    ...of the enterprise application (EAR file). You might specify different values for EJB modules and for web modules such as servlets and JSP files.

    To enable reloading, specify an integer value that is greater than zero (for example, 1 to 2147483647).

    To disable reloading, specify zero (0).

    For IBM extension and binding files, the .xmi or .xml file name extension is different depending on whether you are using a pre-Java EE 5 application or module or a Java EE 5 or later application or module. An IBM extension or binding file is named either...

    • ibm-*-ext.xmi
    • ibm-*-bnd.xmi

    ...where * is the type of extension or binding file such as app, application, ejb-jar, or web. The following conditions apply:

    • For apps and modules that use a Java EE version prior to version 5, the file extension must be .xmi.

    • For apps and modules that use Java EE 5 or later, the file extension must be .xml. If .xmi files are included with the application or module, the product ignores the .xmi files.

    However, a Java EE 5 or later module can exist within an application that includes pre-Java EE 5 files and uses the .xmi file name extension.

    The ibm-webservices-ext.xmi, ibm-webservices-bnd.xmi, ibm-webservicesclient-bnd.xmi, ibm-webservicesclient-ext.xmi, and ibm-portlet-ext.xmi files continue to use the .xmi file extensions.

  4. Specify the class loader order for the application.

    The application class loader order specifies whether the class loader searches in the parent class loader or in the application class loader first to load a class. The default is to search in the parent class loader before searching in the application class loader to load a class.

    Select either of the following values for Classes loader order:
    Option Description
    Classes loaded with parent class loader first Causes the class loader to search in the parent class loader first to load a class. This value is the standard for Development Kit class loaders and WebSphere Application Server class loaders.
    Classes loaded with local class loader first (parent last) Causes the class loader to search in the application class loader first to load a class. By specifying Classes loaded with local class loader first (parent last), the application can override classes contained in the parent class loader.

    Specifying the Classes loaded with local class loader first (parent last) value might result in LinkageErrors or ClassCastException messages if we have mixed use of overridden classes and non-overridden classes.

  5. Specify whether to use a single or multiple class loaders to load web application archives (WAR files) of the application.

    By default, web modules have their own WAR class loader to load the contents of the WEB-INF/classes and WEB-INF/lib directories.

    The default WAR class loader value is Class loader for each WAR file in application, which uses a separate class loader to load each WAR file. Setting the value to Single class loader for application causes the application class loader to load the web module contents as well as the EJB modules, shared libraries, RAR files, and dependency JAR files associated to the application. The application class loader is the parent of the WAR class loader.

    Select either of the following values for WAR class loader policy:
    Option Description
    Class loader for each WAR file in application Uses a different class loader for each WAR file.
    Single class loader for application Uses a single class loader to load all of the WAR files in the application.

  6. Click OK.

Save the changes to the administrative configuration.


Related concepts:

Class loaders


Related


Install enterprise application files with the console
Class loading


Reference:

Enterprise application settings
Class loading and update detection settings


+

Search Tips   |   Advanced Search