Author: Viet Tran (Page 3 of 14)

Maximo fails to connect to SQL Server database

In a recent upgrade, I had to get Maximo 7.6.1.2 to work with SQL Server 2019 (15.0.4198.2 – Jan/2022). 

Initially, I thought I needed to replace the JDBC driver that comes with Maximo with the latest JDBC driver version (10.2). However, it doesn’t solve the issue.

After searching the Web, I came across an article which suggests the problem is due to the new SQL Server version requires SSL protocol TLS 1.2 .

Thus, I managed to fix the issue by adding this parameter to the end of the JDBC connections string: sslProtocol=TLSv1.2;

The full connection string will look as follows:

mxe.db.url=jdbc:sqlserver://;serverName=[SERVERNAME];databaseName=[DBNAME];portNumber=1433;integratedSecurity=false;sendStringParametersAsUnicode=false;sslProtocol=TLSv1.2;

The other method that seems to work too is adding this parameter: -Dcom.ibm.jsse2.overrideDefaultTLS=true to the JVM argument of the Application server, or execution command of any tools running Java such as ScriptBuilder.bat, UpdateDB.bat or IntegrityUI.bat

For example, for the integrityui.bat tool, I edit the file and update it as below:

@..javajrebinjava -Dcom.ibm.jsse2.overrideDefaultTLS=true -Dswing.handleTopLevelPaint=false -classpath %MAXIMO_CLASSPATH% psdi.configure.UpgradeUI -i

Update Aug/2023: I recently had the following database connection error when running UpdateDB.bat with SQL Server 14 SP1:

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "com.ibm.jsse2.util.j: PKIX path building failed

Without digging into which version of TLS is being used, I got it running by adding the following two parameters to the connection string in maximo.properties file:

encrypt=true;trustServerCertificate=true

How to redeploy a single file in Maximo?

Most Maximo settings or Java code can be deployed by copy/paste the file directly to the installed folder in Websphere without having to rebuild and redeploy the application. However, with web.xml, it doesn’t work that way. Sometimes, we need to update this file to increase the timeout setting or enable/disable LDAP integration

Sure, we can directly modify the file in Websphere without redeployment, but we will also have to update the file in a few temporary folders for which, I find the process quite tedious.

To avoid having to rebuild and redeploy the whole maximo.ear file, which can take a lot of time, we can just redeploy the single web.xml file instead. Below is the process:

  • Update the web.xml file with new settings
  • Log in to the Websphere console, open Applications > Application Types > WebSphere Enterprise Applications: select “MAXIMO” application by ticking on the checkbox next to it, click on the Update button
  • In “Application update options“, select “Replace or add a single file” option
  • In the textbox below “Specify the relative path….“, specify: maximouiweb.war/WEB-INF/web.xml
  • In the “Specify the path to the file“, choose “Local file system“, and click on “Choose file” to browse and select the updated web.xml file, click Next. 
  • Click OK on the next screen to deploy. Click Save when the deployment process is completed.
  • Wait for a minute for the new settings to be propagated to all nodes, then restart Maximo.

How to post HTTP requests using Automation script?

I want to post a simple JSON message to an external system and do not want to add any external library to Maximo as it would require a restart.

In the past, I used the Java HTTPClient library that comes with Maximo, but it would require half a page of boilerplate Jython code. Recently, I found a simpler solution below.

Step 1

First I use WebHook as a mock service for testing. Go to webhook.site, it will give us a unique URL to send request to:

    Step 2

    Go to the End Point application in Maximo to create a HTTP Endpoint

    • End Point Name: ZZWEBHOOK
    • Handler: HTTP
    • Headers: Content-Type: application/json
    • URL: <copy/paste the Unique URL from webhook>
    • HttpMethod: POST

    Step 3

    To ensure it’s working, Use the Test button, write some simple text, then click on “TEST”. Maximo should show a successful result. In Webhook, it should also show a new request received. (Note: if it gives an error related to SSL, it’s because Websphere doesn’t trust the target website. You’ll need to add the certificate of the target website to Websphere trust store)

    Step 4

    To send a request, just need two lines of code as follows:

    Update: For a more advanced query requirement, please refer to this new post: Send HTTP Request from Automation Script

    Node Agent cannot start after configuring LDAP

    Just to document a weird issue I had today. I was attempting to configure LDAP (Microsoft AD) for Maximo/Websphere. After it is configured (and I’ve tested that it can query AD data), Application Server security was enabled. Then the server is rebooted to refresh the new configuration.

    After a restart, ctgNode01 (node agent) service cannot start. Node Agent log shows the error below:

    WSVR0100W: An error occurred initializing, nodeagent [class com.ibm.ws.runtime.component.ServerImpl]
    
    com.ibm.ws.exception.ConfigurationError: com.ibm.websphere.ssl.SSLException: CWPKI0316E: Cannot get a security object from the configuration. This can indicate that the security.xml file for the cell is corrupt and you must validate the integrity of the file.

    I looked it up on the web, there are some suggestions about a corrupted security.xml file. So I checked and found that the security.xml file in ctgAppSrv01 profile is completely empty. I looked at other Maximo servers and found this file has an exact same content with the security.xml file from ctgDmgr01 profile. I copied that file over to AppSrv profile, restarted Websphere and it is able to start again.

    Not sure why configuring LDAP would completely wipe out the content of this file.

    Enabling up HTTP Compression for Maximo

    To enable HTTP compression for Maximo, follow the steps below:

    • Make a backup copy of the file: IBM/HTTPServer/conf/httpd.conf
    • Edit the httpd.conf file, enable the following two lines:
    LoadModule deflate_module modules/mod_deflate.so
    LoadModule filter_module modules/mod_filter.so
    • Add the following lines to the bottom of the file:
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript
     
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html
    #Highest 9 - Lowest 1
    DeflateCompressionLevel 4
    • Restart HTTP server

    Implement “Sleep” or “Wait” in WebMethods flow

    I needed to send an external system a file import request. The external system would take some time to process the file before the import result can be queried. Making a status query immediately after the import request would always return an “import process is still running”. It’s best to wait for a few seconds before making the first attempt to query the import status.

    It took quite a bit of time to look up the web for a “wait” or “sleep” function. Some posts suggested using Java flow, some recommended complex processes or involved an external library.

    The easiest method I finally settled with is to use Repeat as follows:

    Essentially, the flow would repeat 1 time in 5 seconds before getting to the next step (Main Mapping). The repeat loop does nothing other than just writing a line in the server log to make troubleshooting a bit easier.
    « Older posts Newer posts »