April 8, 2014

ClassCast exception when launching BIRT reports

Recently I went through a problem running BIRT reports from Maximo. Every time I launch a BIRT report I got a java.lang.ClassCastException exception like this.

java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration incompatible with org.apache.xerces.xni.parser.XMLParserConfiguration

My colleague Daniel Hlawatsch found the solution based on two similar IBM TechNotes:

New Xerces library was introduced in CCMDB
Error connecting to WebServices

To solve the problem you just have to delete org.apache.xerces_2.9.0.v200805270400.jar file (backup this first) from the application server deployed application tree: maximouiweb.war/birtplatform/plugins/

Restart the application server and test BIRT reports.
If the problem is solved you also should eradicate the problem deleting the same file from the SMP directory: [SMPDIR]\maximo\maximouiweb\webmodule\WEB-INF\birt\platform\plugin

April 5, 2014

Change Maximo base web address

In some cases you need to be able to web address of Maximo to identify between different environments or systems. For example for the test system you want to change the base URL from the default address:
  • http://mxhost/maximo/
  • http://mxhost/maximotest/

In WebSphere application server this part of the web address is called 'context root'. It can be changed using WebSphere admin console under Applications > Enterprise Applications > MAXIMO > Context Root For Web Modules.

You can change this setting from WAS console but every time you will redeploy maximo.ear file it will be reset to the default value. To automate this procedure you can set the correct value in the following files.

  • [SMPDIR]\maximo\applications\maximo\META-INF\application.xml
  • [SMPDIR]\maximo\applications\maximo\META-INF\deployment-application.xml

Rebuild and deploy the maximo EAR file and check that everything is working fine.

March 12, 2014

Read system property in a Java class

This entry is part of the Maximo Java Development series.

Here is a small piece of Java code that can be used to retrieve a system property in Java.

Properties configData = MXServer.getMXServer().getConfig();
String prop = configData.getProperty("mxe.adminEmail");

Replace mxe.adminEmail with your property.

February 26, 2014

Multiple Maximo 7.1 installations on the same administrative workstation

As you may already know IBM Maximo 7.1 does not fully support the installation of multiple environments on a single Administrative Workstation. This is partially true since IBM has developed a procedure based on the use of non-administrative system users (see TechNote 21421640). However, I find this as an overly complex technique so I have developed my own personal approach to this problem.

Note: This is an unsupported procedure. Use at your own risk. It is a quite complex procedure but is very effective in the real world.

Background Information

The installation of Maximo on a Windows system will basically create two components:
  • Deployment Engine: The IBM Autonomic Deployment Engine (DE) manages the installation of Maximo. It is typically located in C:\Program Files\IBM\Common\acsi. For more details refer to this video or this PDF.
  • TPAE: Maximo, SCCD and other TPAE-based products are installed in a specific directory that is typically named SMP (I usually install Maximo under D:\IBM\SMP) This contains all the scripts, Java classes and other stuff needed to manage the application and create the maximo.ear file that is deployed on the application server.

The technique described in this article consists in having a backup of those two directories to have the possibility of switching from one environment to another.

The backup is best performed with the robocopy command that is available on recent Windows systems. For Windows XP or Windows 2003 you can download it from here. It has great advantages over xcopy in terms of performances and reliability.

Installation Scenario

To demonstrate the technique I will walk through all the steps needed to install development, test and production environment from a single Admin Workstation. The example assumes you are working in D:\IBM directory.
  1. Install development environment - Launch the Maximo installer and install the development environment in D:\IBM\SMP
  2. Create environment identifiers files
    1. Create an empty file named DEV.txt in the SMP directory: D:\IBM\SMP
    2. Create an empty file named DEV.txt in the DE directory: C:\Program Files\IBM\Common\acsi
  3. Backup installation folders
    1. Copy the whole C:\Program Files\IBM\Common\acsi directory into a new directory C:\Program Files\IBM\Common\acsi_DEV
    2. Copy the whole D:\IBM\SMP directory into a new directory D:\IBM\SMP_DEV
  4. Tweak installation parameters - Update the following files to match the test environment configuration:
    1. D:\IBM\SMP\etc\install.properties
    2. D:\IBM\SMP\maximo\applications\maximo\properties\maximo.properties
  5. Install test environment - Do not launch the installer but clone the development environment
    1. Clone the development database into an empty test database
    2. Build maximo.EAR file and deploy it on the test application server
  6. Create environment identifiers files - Create two empty files named TEST.txt as described in step 2.
  7. Backup installation folder - Backup folder in XXX_TEST folders as described in step 3.
  8. Tweak installation parameters - See step 4.
  9. Install production environment - See step 5.
  10. Create environment identifiers files - Create two empty files named PROD.txt as described in step 2.
  11. Backup installation folder - Backup folder in XXX_PROD folders as described in step 3.

At the end of the process you will have the three environments up and running with a directory structure like this.
  • D:\IBM
    • SMP
    • SMP_DEV
    • SMP_PROD
    • SMP_TEST
Check that you have the correct DEV.txt, TEST.txt and PROD.txt files in each SMP_XXX directory Ensure you have PROD.txt file in the SMP main dir. This allows to identify which environment is currently active.

How to switch environments

Download the SmpSetEnv.cmd script and copy it in D:\IBM dir.
If you double click on the script the following prompt will appear.

The script allows you to switch from one environment to a new one. It will basically perform the following actions:
  1. Display the current active environment in D:\IBM\SMP
  2. Let you choose which environment to activate
  3. Backup D:\IBM\SMP into the appropriate D:\IBM\SMP_XXX directory
  4. Restore the appropriate D:\IBM\SMP_XXX into D:\IBM\SMP
  5. Stop the DE daemon
  6. Backup C:\Program Files\IBM\Common\acsi into the appropriate C:\Program Files\IBM\Common\acsi_XXX directory
  7. Restore the appropriate C:\Program Files\IBM\Common\acsi_XXX into C:\Program Files\IBM\Common\acsi

Remember! Always work in the main SMP directory. The SMP_XXX directories are only used as backups.