Running Maximo 7.6.1 Application in Local PC or Laptop
As a Maximo Developer we might have been in situation where you need to do multiple businessobject custom class deployment within a quick span of time in a shared development environment to achieve a custom functionality. We all know it needs an Application Downtime which might be affecting coworker’s productivity.
So, to overcome this limitation we are going to leverage IBM WebSphere Liberty Support for Maximo 7.6.1. Below IBM Technote provides details of the same in Detail as of 31-07-2020.
Basically, in this post I am going to focus on how to setup a Local Maximo(Application Layer) running on developers’ laptop or pc using WebSphere Liberty.
List of things needed for setup
- WebSphere Liberty – 89.7MB (https://developer.ibm.com/wasdev/downloads/#asset/runtimes-wlp-webProfile8)
- Copy of SMP Folder from Development Environment. (Linux -/opt/IBM/SMP or Windows - C:\IBM\SMP)
Downloading WebSphere Liberty:
Once downloaded please extract the wlp-webProfile8-220.127.116.11.zip to a comfortable location. In my case I have done it to D:\DevSpace\WASLiberty\libertyinstalled. That’s it our Application Server Ready.
SMP Folder Setup: Similarly, now we need to place of Copy of SMP folder from dev server to comfortable location. In my case I have copied it to D:\DevSpace\Dev
Before building apps from SMP folder for WAS Liberty, we need to handle few things to avoid application startup issue or build error.
DOS line endings error (linux only):
While running the ./buildmaxmoui-war.sh I got the following error:
bash: ./buildmaximoui-war.sh: /bin/sh^M: bad interpreter: No such file or directory
This error is due to Windows/DOS file endings on Linux.
Open file in vi/vim, see if there are any ^M characters appearing. If found, remove ^M characters manually and save.
XMLChar class not found error:
Build works fine without this fix, but Maximo is not able to start complaining about missing XMLChar class. To fix it, comment out the following line in buildmaximoui.war.xml and buildmaximocron-war.xml
<!--<exclude name="xercesImpl-2.7.1.jar"/> -->
Build command shows a warning that tools.jar is missing. To fix it copy the tools.jar from /SMP/maximo/applications/maximo/lib to JAVA_HOME/jre/lib/.
Now we are setup to build our apps for WAS Liberty.
Building Maximo Apps for WAS Liberty:
Maximo 7.6.1 comes with new tools for building Maximo for liberty. Maximo is built into 7 application bundles which are deployed as separate servers on Liberty (except maximo-ui and maximo-x which are deployed together).
As we are going to use same development database, we are not modifying maximo.properties file under SMP/maximo/applications/maximo/properties folder.
Commands to build minimal apps required to run maximo
In my case I’m using Windows 10 so to run the commands, first need to change the current directory to below path D:\DevSpace\Dev\SMP\maximo\deployment\was-liberty-default.
Open command prompt in windows using run as administrator option and change the current directory to above mentioned path using cd command.
Now we must build the maximoui bundle using buildmaximoui-war.cmd , buildmaximo-xwar.cmd command and build will take few minutes to complete.
Similarly, we must build the maximocron bundle using buildmaximocron-war.cmd
Setting up Websphere Liberty:
Ensure valid JDK8 is installed in the machine and JAVA_HOME Environment variable is pointing to the JDK8 before installing our maximo bundles into WebSphere Liberty.
Create servers for maximoui and maximocron bundle in WAS Liberty using following command
$server create maximo-ui-server
$server create maximo-cron-server
>server.bat create maximo-ui-server
>server.bat create maximo-cron-server
From command prompt change the current directory to WASLiberty/bin
In my case D:\DevSpace\WASLiberty\libertyinstalled\bin
Installing Maximo Bundles to Websphere Liberty:
Copy contents of SMP/maximo/deployment/was-liberty-default/deployment/ maximo-ui\maximo-ui-server to /WASLiberty/libertyinstalled/usr/servers/maximo-ui-server and overwrite if asked.
In my case I copied contents from D:\DevSpace\Dev\SMP\maximo\deployment\was-liberty-default\deployment\maximo-ui\maximo-ui-server to D:\DevSpace\WASLiberty\libertyinstalled\usr\servers\maximo-ui-server
Similarly, for maximocron bundle
I copied contents from D:\DevSpace\Dev\SMP\maximo\deployment\was-liberty-default\deployment\maximo-cron\maximo-cron-server to D:\DevSpace\WASLiberty\libertyinstalled\usr\servers\maximo-cron-server
After copying maximo bundles to WAS Liberty server we need to install dependency files using below commands/
This step requires Internet connectivity.
$installUtility install maximo-ui-server
$installUtility install maximo-cron-server
> installUtility.bat install maximo-ui-server
> installUtility.bat install maximo-cron-server
In my case I run above commands from WASLiberty/bin directory from command prompt
Starting Maximo Applications:
To start the installed maximo bundles use the following commands.
(Minimum 4GB RAM Free space) is required to run the maximo apps.
$server start maximo-ui-server
$server start maximo-cron-server
> server.bat start maximo-ui-server
> server.bat start maximo-cron-server
From command prompt change current directory to WASLiberty/bin and run above commands.
In my case I followed below steps. Applications will start and be accessible in few minutes (depends on our connection speed to database server).
Once application is started maximo is available in below url(s)
http://<HOSTNAME or IP>:9080/maximo
https://<HOSTNAME or IP>:9443/maximo
The above ports can be changed from Server.xml located in D:\DevSpace\Dev\SMP\maximo\deployment\was-liberty-default\deployment\maximo-ui\maximo-ui-server if the default http port 9080 and https port 9443 is used by another applications. Now maximo application is running from local pc or laptop.
For deployment we need to update the businessobjects.jar inside maximoui.war using 7Zip utility directly without stopping the server.
Exact path of businessobjects.jar is as follows in my case D:\DevSpace\Dev\SMP\maximo\deployment\was-liberty-default\deployment\maximo-ui\maximo-ui-server\apps\maximoui.war\WEB-INF\lib\.
Happy Coding and deployment.