IBM Websphere Classloading set to PARENT_LAST

Reading Time: 3 minutes

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.



JVMCFRE003 bad major version; class=javax/servlet/ServletContextListener

Reading Time: 1 minute

This is issue recently occurred at work while I was working on the migration to IBM WAS 8.5. The migration was from WAS 7.0 and JDK 1.6 to WAS 8.5 JDK1.8. The issue rises if you compile the project with a different(in my case lower) JDK version that the installed on the server. To resolve this issue compile the project with the proper java version.

Creating a shared library in IBM WebSphere Application Server

Reading Time: 2 minutes

Shared library is a splendid feature offered by many of J2EE servers which reduces the size of war files. However, one of key benefit of the shared library is that, if you want to use JSF version 2.2 which is not offered by WAS 8.5, you can simply use your own libraries. To do that I’ll use the below maven configuration;


The instructions as follow;

1. Download all these jar files from the maven repository,

2. Navigate to your WAS folder in my case “C:\Program Files (x86)\IBM\WebSphere\AppServer\” then go to the “lib” folder, here create a new folder and move all the downloaded jar files here

3. Go to your WAS console and navigate to “Environment >> WebSphere variables” create variables as “JSF_LIB_HOME”
value “${WAS_INSTALL_ROOT}/lib/jsflibs” in each scope

4. Then navigate to “Environment >> Shared libraries” for name enter “JSF” and the classpath;


5. Then navigate to “Applications >> Application Types >> WebSphere enterprise applications” here select your application. In this chapter we will take two actions;

5.1. In the “JSP and JSF options” page the “DEFAULT” value should be selected

5.2. In the “Shared library references” page refer your JSF library to the EAR, you can also point it to your WAR too.

6. Then test your application



useful links:

org/glassfish/admin/cli/AsadminMain : Unsupported major.minor version 51.0

Reading Time: 1 minute

This issue occurs when you try to launch Glassfish 4 with JDK 1.6 or lower versions. If you have a seperated jdk 1.7 not installed a zip archive go to


here find asenv.bat and edit it and add the following line with your jdk version

set AS_JAVA=C:\Program Files\Java\jdk1.7.0_55

Changing Jboss 7.1 port

Reading Time: 1 minute

Find standalone.xml file and find the lines:

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-native" interface="management" port="${}"/>
        <socket-binding name="management-http" interface="management" port="${}"/>
        <socket-binding name="management-https" interface="management" port="${}"/>
        <socket-binding name="ajp" port="9009"/>
        <socket-binding name="http" port="9000"/>
        <socket-binding name="https" port="9043"/>
        <socket-binding name="osgi-http" interface="management" port="9001"/>
        <socket-binding name="remoting" port="9447"/>
        <socket-binding name="txn-recovery-environment" port="9712"/>
        <socket-binding name="txn-status-manager" port="9713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="localhost" port="25"/>

Increasing Websphere heap size

Reading Time: 2 minutes


At work I was dwelling on uploading a big fat war file on websphere application server, and ended up facing perm gem space out of memory error. Finally I ended up finding out the solution to prevent this issue. Fire up your websphere web server and launch the administration console



Here navigate to Servers > Server types > Websphere Application servers and click on server1 or whatever it is named in your server



Here on the right menu find Server Infrastructure and click on Process definition




Here on the right side menu click on Java Virtual Machine



In this screen where we will set the heap size. For the sample configuration I have 8GB of ram at my work PC and I upload big war and ear files thus I have set Initial heap size 512MB and Maximum heap size 1024MB, this is up to you how much space you will assign to Websphere server


There is one more setting that I strongly suggest you to do is to disable garbage collection. This is optional.


When you are all good to go, you ran restart the server and start uploading big packages


Defining a data source in IBM Websphere

Reading Time: 4 minutes


In this post I will be showing you how to define a datasource to databases. At work I needed to launch a project in my local server, and the project requires a database connection which has to be also defined in IBM WAS. The below everything you need is declared and explained. I will define an oracle data source.

First of all fire up the was server, I am running STS and it is defined in my server list. After the server is fired up, we need to launch to the Administration console

IBMWebsphere 1

This is the main layout of the administration console of IBM WAS

IBMWebsphere 2

First of all we need to set oracle jdbc driver path for WAS to use the jar.  Here you can download it. The jar is not available in maven repository, so that you will need to download it from Oracle’s web site. Please keep in mind we need to have ojdbc6 one not the ojdbc5.  Once you download it, we need to keep the file in a permanent location where “YOU WILL NOT DELETE” because as long as the data source is defined in server, you will have to keep it for WAS, I am assuming that you are keeping the jar in somewhere in C drive or in linux your home folder.

After downloading and locating the jar file move Navigate to Environment > WebSphere variables

Keep in mind you really need to know about the scope part. I am running my server in local so that in general the one selected in option box in my server is the right for local servers. Anyway here click on “ORACLE_JDBC_DRIVER_PATH” if it is not defined add a new one from the button

IBMWebsphere 3

Here the screen comes up, to the value textfield we only need to add the PATH of the jar file NOT PATH+FILENAME. As long as the jar file named as ojdbc6.jar WAS will automatically pick the file up. if your jar is in C:\libs just type it that way

IBMWebsphere 4


When you are done click on Apply, Okay and Save it The sample output should be like this:

IBMWebsphere 5


If we succeeded  on file path definition now navigate to Security > Global Security > Java Authentication and Authorization Service > J2C Authentication Data

IBMWebsphere 6



Here we have no options click on New

IBMWebsphere 7


In this screen we will be defining our data sources username and password. Please make sure your Credentials are IDENTICALLY THE SAME

IBMWebsphere 8


For Alias you can type anything you want, User ID is username and Password is the password of course. Description is optional, Alias could be named the way you wish When we are done the sample screen should be looking like this:

IBMWebsphere 9


Now navigate to Resources > JDBC > JDBC Providers

IBMWebsphere 10


Here you see nothing is defined, Click on new

IBMWebsphere 11



Database Type: Oracle

Provider Type: Oracle JDBC Driver

Implementation Type: Connection Pool Data Source

Name: Oracle JDBC Driver

Description: Oracle JDBC Driver

Once completed click on next

IBMWebsphere 12


In this screen oracle jar file path definition is required, since we have already defined, skip this part

IBMWebsphere 13


When we finish the output screen should be

IBMWebsphere 14


Now In the same screen click to Data Sources

IBMWebsphere 15


As you see nothing is defined click on New button to define one

IBMWebsphere 16


Data source name: Oracle JDBC Driver

JNDI Name: jdbc/OracleDS

Once completed click on next

IBMWebsphere 17


Here select the existed JDBC provider

IBMWebsphere 18


Here we need to define the oracle full url it should be jdbc:oracle:thin:@//SERVERADDRESS/SCHEMA

Choose Oracle 11g data store helder and check the option click on Next

IBMWebsphere 19


Here we will choose what we defined in JDBC Providers page

once completed click on next. The sample output looks like below

IBMWebsphere 20


Once everything is done the next page we will test the connection. Check on the defined source and click on test. If all went successfully the server will return a successful message

IBMWebsphere 21

Tomcat 7: exceeds the configured maximum capacity cannot upload larger than 50mb

Reading Time: 1 minute

Well today at work i was gonna present my work and I didnot wanna mess up with tomcat 6 configured and works on my project, I stopped tomcat 6 and launched tomcat 7 already had the war file. So as usual I fired up tomcat 7 and launched the manager console and pointed my war file to be uploaded, but unfortunately I faced an issue that tomcat 7 manager cannot upload larger than 50MB! So the solution is very simple

  1. Stop tomcat 7 server
  2. navigate to the TOMCAT7FOLDER/webapps/manager/WEB-INF/
  3. edit web.xml file with your favorite text editor
  4. go to the line starts with <max-file-size> and alter the size you want
  5. go to the line starts with <max-request-size> and alter the size you want
  6. Fire up the tomcat 7 app server

And give it another shot to upload your larger war file.

Glassfish start and stop domain on Windows

Reading Time: 1 minute

From the command line we can start and stop the domain by carrying out the following codes, I assume that you have installed glassfish 4 in root C drive

Start a domain:

C:\glassfish4\glassfish\bin\asadmin.bat start-domain domain1

Stop a domain:

C:\glassfish4\glassfish\bin\asadmin.bat stop-domain domain1