You can configure whether your application and Web modules use their own class loaders to load classes or use different class loaders, as well as configure the reloading of classes when application files are updated. Class loaders enable an application to access repositories of available classes and resources. This topic assumes that your application or module is already deployed on a server.
An application class loader groups enterprise bean (EJB) modules, shared libraries, resource adapter archives (RAR files), and dependency Java archive (JAR) files associated to an application. Dependency JAR files are JAR files that contain 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.
You can also select whether classes are reloaded when application files are updated. For enterprise bean (EJB) modules or any non-Web modules, enabling class reloading causes the application server run time to stop and start the application to reload application classes. For Web modules such as servlets and JavaServer Pages files, a Web container reloads a Web module only when the IBM extension reloadingEnabled in the ibm-web-ext.xmi file is set to true.
To configure use of class loaders by your application and Web modules, use the Class loading and update detection page of the administrative console. Attention: 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.
By default, class reloading is not enabled. Select Reload classes when application files are updated to choose to reload application classes. You might specify different values for EJB modules and for Web modules such as servlets and JavaServer Pages 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) file 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).
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 Class 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 application class loader first | Causes the class loader to search in the application class loader first to load a class. By specifying Classes loaded with application class loader first, your application can override classes contained in the parent class loader. Attention: Specifying the Classes loaded with application class loader first value might result in LinkageErrors or ClassCastException messages if you have mixed use of overridden classes and non-overridden classes. |
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 your application. |
If the application or module is deployed on a cluster and you have no more configuration changes to make, click Rollout Update on the Enterprise Applications page to propagate the changed configuration on all cluster members of the cluster on which the application or module is deployed. Rollout Update sequentially updates the configuration on the nodes that contain cluster members.
Save changes to your administrative configuration.
On
the Network Deployment product, the application binaries are transferred to
nodes when the configuration changes on the deployment manager synchronize
with configurations for individual nodes on which the application will run.