IBM Websphere Classloading set to PARENT_LAST

Posted by

The main responsibility of class loaders is to find and load the classes[1]. What do we get to do with this. First I’d like to explain the first terms. In class loading we have;

  • PARENT_LAST: Allows us to use the jars that we provide,
  • PARENT_FIRST: Uses existing jars provided by the WAS.

How does this help us? Well if you are using different jar stack than IBM provides, like JSF library in my case, then you will have some troubles with it. In our project our stack was JSF 2.2 Mojarra and Primefaces 6.0 with JDK 1.8. This option can be found All Applications > APPLICATION > Class loader.

However, this option is global setting. If your project EAR, contains multiple WAR files and context and some of them shall be excluded from this operation. Well you can also set class loading separately on the WAS console

All Applications > APPLICATION > Manage Modules > MODULE.war

I assume that the disadvantage of setting the class loading on the console is not permanent, every time you need to make this setting. However, there is an alternative way to set the class loading in a class way during the deployment. In my example I’ll show an EAR having 2 modules, one of them the JSF project will have the class loading set as PARENT_LAST and the other project as a default setting will have the PARENT_FIRST option. The target project is a maven multiple module project [2] [3]. We will succeed this operation by using a deployment.xml file in the EAR project.

Parent pom.xml

The version of the jsf project is kept here, I’ll explain the main reason further.


Ear project pom.xml

<?xml version="1.0"?>
<project xsi:schemaLocation="" xmlns=""


Here you don’t have to create an explicit application xml file that has the settings for each project.  In the ear pom, the <generateApplicationXml> tag will create one for you.

Creating path for deployment.xml file

Now this is the very tricky part. You have to create the following path in your EAR project accordingly;



Now after we are sure that the above folders are created successfully, then we can create our file

<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="" xmlns:appdeployment="" xmi:id="Deployment_1495796489455">
  <deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1495796489455" startingWeight="100">
    <modules xmi:type="appdeployment:WebModuleDeployment" startingWeight="10000" uri="WINSSupportToolWeb-1.0.0.war" classloaderMode="PARENT_LAST"/>
<!-- To set the classloading level as "PARENT_LAST" for the whole modules, remove the above line and commment out the below line -->
<!--<classloader xmi:id="Classloader_1297859327856" mode="PARENT_LAST"/>-->

you need to ensure that maven will create the project as it is defined in the detployment.xml file, otherwise it will not work out.



Leave a Reply

Your email address will not be published. Required fields are marked *