November 16, 2022
Maximo Application Suite (MAS) is coming and will make all of what we are about to talk about irrelevant. Even so, doing away with the hassle of manually deploying EAR files and waiting for what seems forever for the process to complete has been a personal desire for as long as I can remember and one that I never quite got around to. Until now, at the 11th hour in the twilight of Maximo 7.6, when I finally sat down and wrote the scripts to do just that. In this post we are going to discuss how to automate deploying the Maximo EAR, step by step with the scripts provided for download. So as the long process of the sun setting on WebSphere traditional continues, for those of you still not on MAS, this post will make your remaining days with WebSphere just a little more pleasant.
Before getting started, I want to highlight an IBM tech note I came across a few months back that drastically reduces the time to deploy the EAR, even if you are doing it manually. By precompiling the EJB classes you can reduce the EAR deployment by several minutes. https://www.ibm.com/support/pages/reducing-maximoear-deployment-time-using-ejbdeploy
We are going to use the wasclient
provided in the Maximo SMP ConfigTool directory to communicate with WebSphere, but first there are a few configuration steps we need to complete. The steps are almost identical for Windows and Linux, but to avoid possible confusion we have provided the configuration steps separately for Windows and Linux.
For the following steps we are going to use D:\IBM\SMP
as the example SMP home folder and D:\IBM\WebSphere
for the WebSphere installation folder, this is a very common configuration, but this is provided as an example and should be modified to match your environment.
D:\IBM\SMP\ConfigTool\wasclient\Thisnwsadmin.orig.bat
to D:\IBM\SMP\ConfigTool\wasclient\Thisnwsadmin.bat
.D:\IBM\SMP\ConfigTool\wasclient\Thisnwsadmin.bat
in a text editor such as Notepad, Notepad++ or VS Code.set WAS_HOME=$WASHOME$
and change it to set set WAS_HOME=D:\IBM\SMP\ConfigTool\wasclient
.set JAVA_HOME=$JAVAHOME$
and change it to set set JAVA_HOME=D:\IBM\SMP\ConfigTool\jre
.D:\IBM\WebSphere\AppServer\profiles
folder and is a folder typically named ctgDmgr01
, as in our example, or similar. Copy the D:\IBM\WebSphere\AppServer\profiles\ctgDmgr01\etc\trust.p12
and D:\IBM\WebSphere\AppServer\profiles\ctgDmgr01\etc\key.p12
files to the D:\IBM\SMP\ConfigTool\wasclient\etc
folder.D:\IBM\SMP\ConfigTool\wasclient\properties\ssl.client.props
file in a text editor.com.ibm.ssl.keyStore
property and set its value to D:\IBM\SMP\ConfigTool\wasclient\etc\key.p12
. com.ibm.ssl.trustStore
property and set its value to D:\IBM\SMP\ConfigTool\wasclient\etc\trust.p12
.ssl.client.props
file and close the text editor.wsadminlib.py
script from the IBM GitHub repository found here https://github.com/wsadminlib/wsadminlib/blob/master/bin/wsadminlib.py. wsadminlib.py
script to the D:\IBM\SMP\ConfigTool\scripts
folder.deploy-application.py
script from here.deploy-application.py
script to the D:\IBM\SMP\Config\scripts
folder.D:\IBM\SMP\Config\scripts\deploy-application.py
file in a text editor.execfile('SCRIPTS_HOME/wsadminlib.py')
and update it to execfile('D:\IBM\SMP\Config\scripts\wsadminlib.py')
.deploy-application.py
file and close the text editor.For the following steps we are going to use /opt/IBM/SMP
as the example SMP home directory and /opt/IBM/WebSphere
for the WebSphere installation directory, this is a very common configuration, but this is provided as an example and should be modified to match your environment.
/opt/IBM/SMP/ConfigTool/wasclient/Thisnwsadmin.orig.sh
to /opt/IBM/SMP/ConfigTool/wasclient/Thisnwsadmin.sh
./opt/IBM/SMP/ConfigTool/wasclient/Thisnwsadmin.sh
in a text editor such as nano, vim or vi.export WAS_HOME=$WASHOME$
and change it to set export WAS_HOME=/opt/IBM/SMP/ConfigTool/wasclient
.export JAVA_HOME=$JAVAHOME$
and change it to set export JAVA_HOME=/opt/IBM/SMP/ConfigTool/jre
./opt/IBM/WebSphere/AppServer/profiles
directory and is a directory typically named ctgDmgr01
, as in our example, or similar. Copy the /opt/IBM/WebSphere/AppServer/profiles/ctgDmgr01/etc/trust.p12
and /opt/IBM/WebSphere/AppServer/profiles/ctgDmgr01/etc/key.p12
files to the /opt/IBM/SMP/ConfigTool/wasclient/etc
directory./opt/IBM/SMP/ConfigTool/wasclient/properties/ssl.client.props
file in a text editor.com.ibm.ssl.keyStore
property and set its value to /opt/IBM/SMP/ConfigTool/wasclient/etc/key.p12
. com.ibm.ssl.trustStore
property and set its value to /opt/IBM/SMP/ConfigTool/wasclient/etc/trust.p12
.ssl.client.props
file and close the text editor.wsadminlib.py
script from the IBM GitHub repository found here https://github.com/wsadminlib/wsadminlib/blob/master/bin/wsadminlib.py. wsadminlib.py
script to the /opt/IBM/SMP/ConfigTool/scripts
directory.deploy-application.py
script from here.deploy-application.py
script to the /opt/IBM/SMP/Config/scripts
directory.For Windows, download the deploy-application.ps1
script from here, then copy it to the D:\IBM\SMP\ConfigTool
folder.
To use the script open a Windows PowerShell session and navigate to the D:\IBM\SMP\ConfigTool
folder. Run the deploy-application.ps1
script providing the necessary arguments as shown in the example below. Note that a password was not provided as an argument and will be securely prompted for by the script after validating the provided arguments.
D:\IBM\SMP\ConfigTool\deploy-application.ps1 -AppName MAXIMO -CellName ctgCell01 -ServerName MXServer -WebServerName webserver1 -NodeName ctgNode01 -UserName wasadmin -VirtualHost maximo_host -EARFile D:\IBM\SMP\maximo\deployment\default\maximo.ear -HostName localhost
A full table of the available arguments is provided below. The script supports both stand alone servers and clusters, but only supports mapping the application to a single web server.
Argument | Description |
---|---|
-AppName | The name of the application to deploy, such as MAXIMO . |
-CellName | The WebSphere cell name, for example ctgCell01 . |
-ClusterName | The name of the cluster to deploy the application to, for example MXUICluster . |
-EARFile | The path to the Maximo EAR file to deploy, for example D:\IBM\SMP\maximo\deployment\default\maximo.ear . |
-HostName | The name of the WebSphere deployment manager host. |
-NodeName | The WebSphere Node name that hosts the web server, for example ctgNode01 . |
-Password | The WebSphere user password. |
-ServerName | The application server name to deploy the application to, for non-clustered environments, for example MXServer . |
-UserName | The WebSphere username. |
-VirtualHost | The name of the virtual host to deploy the application to, for example maximo_host . |
-WebServerName | The name of the web server to bind the application to, for example webserver1 |
-Help | Prints a help message with the available parameters. |
For Linux, download the deploy-application.sh
script from here, then copy it to the /opt/IBM/SMP/ConfigTool
directory.
In case the
deploy-application.sh
script is not executable run the following command to ensure it has the proper bit flags are set.chmod ugo+x /opt/IBM/SMP/ConfigTool/deploy-application.sh
To use the script open a Bash shell session and navigate to the /opt/IBM/SMP/ConfigTool
directory. Run the deploy-application.sh
script providing the necessary parameters as shown in the example below. Note that a password was not provided as an argument and will be securely prompted for by the script after validating the provided arguments.
/opt/IBM/SMP/ConfigTool/deploy-application.sh -a MAXIMO -c ctgCell01 -s MXServer -w webserver1 -n ctgNode01 -u wasadmin -v maximo_host -e /opt/IBM/SMP/maximo/deployment/default/maximo.ear -h localhost
A full table of the available arguments is provided below. The script supports both stand alone servers and clusters, but only supports mapping the application to a single web server.
Parameter | Description |
---|---|
-a | --appname | The name of the application to deploy, such as MAXIMO . |
-c | --cellname | The WebSphere cell name, for example ctgCell01 . |
--clustername | The name of the cluster to deploy the application to, for example MXUICluster . |
-e | --earfile | The path to the Maximo EAR file to deploy, for example /opt/IBM/SMP/maximo/deployment/default/maximo.ear . |
-h | --hostname | The name of the WebSphere deployment manager host. |
-n | --nodename | The WebSphere Node name that hosts the web server, for example ctgNode01 . |
-p | --password | The WebSphere user password. |
-s | --servername | The application server name to deploy the application to, for non-clustered environments, for example MXServer . |
-u | --username | The WebSphere username. |
-v | --virtualhost | The name of the virtual host to deploy the application to, for example maximo_host . |
-w | --webservername | The name of the web server to bind the application to, for example webserver1 . |
--help | Prints a help message with the available parameters. |
In this post we reviewed how to use the Maximo ConfigTool's wasclient to automate deploying the Maximo EAR file. This comes a little late since Maximo 7.6 is coming to its end of life. However, even being spared the unpleasantness of manually deploying the EAR file for the few remaining years is worthwhile and worth posting about. We hope this makes your life just a little brighter and a little easier.
If you have any questions or comments please reach out to us at [email protected]