Show TOC

Background documentationHeavy Class Loaders Locate this document in the navigation structure

 

Heavy class loaders load application classes with the highest priority.

How They Work

Heavy loaders work in the following manner:

  • They are created with the resources located in the lib folder in the root of the EAR or in the folder defined as a value of XML tag <library-directory> in application.xml, only when the application version is Java EE 5. If the application is developed before Java EE 5, then the empty XML tag <enableHeavyClassloadingBeforeJavaEE5 /> has to be added to file META-INF\applicaton-service.xml to enable the heavy-class-loading feature.

  • It is the first in the parent list. This guarantees the following delegation order when loading a resource:

    • Heavy loader (and its parent, respectively)

    • Default references, specified by the containers during deploy. Usually contain the standard Java EE APIs.

    • Application-specific references (specified in the application-j2ee-engine.xml)

    • All other application resources contained in the EAR

Activating Heavy Loaders

To activate the heavy loaders:

  1. Check if the heavy class loaders behavior is switched on.

    1. Start the Config tool.

    2. Expand the   cluster-data   template   instance   services   node in the cluster tree.

    3. Locate the library_container service.

    4. Check if the value of the Define_Heavy_Resources property is set to true.

      1. If it is set to true, there is no need for change.

      2. If it is set to false, set it to true, save the change, and restart the whole instance for the change to take effect.

  2. Check that the heavy class loader is created and contains all the custom JARs (for example, provided that you have packed the custom JARs as a bundled library for heavy class loading in the application named com.vendorX/Hibernate).

    1. Using telnet, enter:

      >ll | grep com.vendorX/Hibernat|e

    2. You should get two class loaders as the output:

      [com.vendorX/Hibernate]

      [com.vendorX/Hibernate-library-loader]

      The second one is the heavy class loader.