Monday, December 2, 2019

Websphere Application server failed to start after Applying patch

 

Websphere Application server failed to start after Applying 8.5.5.18 patch . From the logs i see below error .

[11/21/20 20:32:17:992 GMT+08:00] 00000001 SSLComponentI A   CWPKI0007I: SSL service failed to start successfully
[11/21/20 20:32:17:994 GMT+08:00] 00000001 WsServerImpl  E   WSVR0100W: An error occurred initializing, server1 [class com.ibm.ws.runtime.component.ServerImpl]
com.ibm.ws.exception.ConfigurationError: com.ibm.websphere.ssl.SSLException: java.lang.NullPointerException
 at com.ibm.ws.ssl.core.SSLComponentImpl.initialize(SSLComponentImpl.java:208)
...
Caused by: java.lang.NullPointerException
 at com.ibm.ws.ssl.config.WSKeyStore$1.run(WSKeyStore.java:745)
 at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
 at com.ibm.ws.ssl.config.WSKeyStore.do_getKeyStore(WSKeyStore.java:645)
 at com.ibm.ws.ssl.config.WSKeyStore.getKeyStore(WSKeyStore.java:911)
 at com.ibm.ws.ssl.config.WSKeyStore.initializeKeyStore(WSKeyStore.java:1098)
 at com.ibm.ws.ssl.config.SSLConfigManager.parseSecureSocketLayer1(SSLConfigManager.java:1191)
 at com.ibm.ws.ssl.config.SSLConfigManager.parseSSLConfig(SSLConfigManager.java:751)
 at com.ibm.ws.ssl.config.SSLConfigManager.initializeServerSSL(SSLConfigManager.java:302)
FFDC:
[11/21/20 20:32:17:937 GMT+08:00]     FFDC Exception:java.lang.NullPointerException SourceId:com.ibm.ws.ssl.core.SSLConfigManager.initializeServerSSL ProbeId:312 Reporter:com.ibm.ws.ssl.config.SSLConfigManager@6e37fe8a
java.lang.NullPointerException
 at com.ibm.ws.ssl.config.WSKeyStore$1.run(WSKeyStore.java:745)
 at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
 at com.ibm.ws.ssl.config.WSKeyStore.do_getKeyStore(WSKeyStore.java:645)
 at com.ibm.ws.ssl.config.WSKeyStore.getKeyStore(WSKeyStore.java:911)
 at com.ibm.ws.ssl.config.WSKeyStore.initializeKeyStore(WSKeyStore.java:1098)
 at com.ibm.ws.ssl.config.SSLConfigManager.parseSecureSocketLayer1(SSLConfigManager.java:1191)
 at com.ibm.ws.ssl.config.SSLConfigManager.parseSSLConfig(SSLConfigManager.java:751)
 at com.ibm.ws.ssl.config.SSLConfigManager.initializeServerSSL(SSLConfigManager.java:302)
 at com.ibm.ws.ssl.core.SSLComponentImpl.initialize(SSLComponentImpl.java:145)
.
So something related to your security settings..

This error occurs on the environment where custom password jar is used . and there is are testfixes available .Just like add JVM arguements

-Dcom.ibm.wsspi.security.crypto.customPasswordEncryptionClass=com.ibm.wsspi.security.crypto.CustomPasswordEncryptionImp -Dcom.ibm.wsspi.security.crypto.customPasswordEncryptionEnabled=true

Official IFIX is also available . Refer below link to download from IBM site .

https://www.ibm.com/support/fixcentral/swg/selectFixes?product=ibm%2FWebSphere%2FWebSphere+Application+Server&fixids=8.5.5.18-WS-WAS-IFPH32041&source=SAR&function=fixId&parent=ibm/WebSphere

Monday, November 4, 2019

How to generate channel tab and alter it

 How to generate channel tab and alter it ??

The client channel definition table (CCDT) determines the channel definitions and authentication information used by client applications to connect to the queue manager.

Ex:It has channel name ,ConnName ,QMGRName,cipher … etc

The purpose of the client channel definition table (CCDT) is to determine the channel definitions used by client applications to connect to the queue manager. The channel definition also specifies the authentication information that applies to the connections.
The CCDT is a binary file. It is generated by a queue manager. The queue manager does not read the CCDT file.

There are a number of ways for a client application to use a CCDT. The CCDT can be copied to the client computer. You can copy the CCDT to a location shared by more than one client. You can make the CCDT accessible to the client as a shared file, while it remains located on the server.

If you use FTP to copy the file, use the bin option to set binary mode; do not use the default ASCII mode. Whichever method you choose to make the CCDT available, the location must be secure to prevent unauthorized changes to the channels.

The CCDT is created when the queue manager is created. Each entry of a CCDT represents a client connection to a specific queue manager. A new entry is added when you define a client-connection channel using the DEFINE CHANNEL command, and the entry is updated when you alter the client-connection channels by using the ALTER CHANNEL command.

The path to the CCDT can be changed by setting MQCHLLIB. If you do set MQCHLLIB, be aware, if you have multiple queue managers on the same server, they share the same CCDT location.

On Linux/AIX
/var/mqm/qmgrs/QUEUEMANAGERNAME/@ipcc
On Windows
MQ_INSTALLATION_PATH\data\qmgrs\QUEUEMANAGERNAME\@ipcc

MQCHLTAB specifies the name of the file containing the client channel definition table (ccdt). The default file name is AMQCLCHL.TAB.

On Windows:
SET MQCHLTAB=filenameCopy code
On UNIX and Linux® systems:
export MQCHLTAB=filename

Let us create a chaneel tab file for the below connection from QMGR

DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
DEFINE CHANNEL(CL.APPQM1) CHLTYPE(SVRCONN) TRPTYPE(TCP) 
[mqm@ip-172-31-14-154 ~]$ runmqsc APPQM1
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager APPQM1.


DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
     1 : DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
AMQ8014I: IBM MQ channel created.
DEFINE CHANNEL(CL.APPQM1) CHLTYPE(SVRCONN) TRPTYPE(TCP) 
     2 : DEFINE CHANNEL(CL.APPQM1) CHLTYPE(SVRCONN) TRPTYPE(TCP) 
AMQ8014I: IBM MQ channel created.
end
     3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
[mqm@ip-172-31-14-154 ~]$

AMCLCHL.TAB file is a binary file . If we view we can see connection information but cannot read complete file .

Now if i want to create another Channel tab from the same QMGR with different channel then it is difficult because this file will be modified or updated with all the channel information from the QMGR .

From the Latest version onwards we have an easy way to generate Channel Tab using runmsc -n command .
By default runmqsc -n Look for the channle tab in /var/mqm . If we run this command then it will read the file from that location if exist otherwise it will create new so that we can update the definitons of channels that we intended to create for Application connectivity .

Note: We only need SVRCONN on QMGR Side . CLNTCONN is only need for Application that used CHLTAB file . so we will define only CLNTCONN on channel tab file .

[mqm@ip-172-31-14-154 @ipcc]$ cd /var/mqm
[mqm@ip-172-31-14-154 ~]$ ls -lrt
total 24
drwxrwsr-x.  3 mqm mqm   19 Dec 29 15:56 conv
drwxrwsr-x.  2 mqm mqm    6 Dec 29 15:56 config
drwxrwsr-x.  3 mqm mqm   27 Dec 29 15:56 web
drwxrwsrwx.  2 mqm mqm    6 Dec 29 15:56 trace
-rw-rw-r--.  1 mqm mqm 1941 Dec 29 15:56 service.env
drwxrwsr-x.  5 mqm mqm   53 Dec 29 15:56 mqft
drwxrwsr-x.  4 mqm mqm   32 Dec 29 15:56 shared
-rw-rw-r--.  1 mqm mqm  661 Dec 29 15:56 mqclient.ini
drwxrwsr-x.  3 mqm mqm   27 Dec 29 15:56 exits
drwxrwsr-x.  3 mqm mqm   27 Dec 29 15:56 exits64
drwxrwsr-x. 15 mqm mqm  177 Jan  4 11:44 sockets
drwxrwsr-x. 15 mqm mqm  177 Jan  4 11:44 qmgrs
-rw-rw-r--.  1 mqm mqm 3674 Jan  4 11:44 mqs.ini
drwxrwsr-x. 14 mqm mqm  162 Jan  4 11:44 log
drwxrwsrwx.  2 mqm mqm 8192 Jan  9 07:06 errors
[mqm@ip-172-31-14-154 ~]$ 
[mqm@ip-172-31-14-154 ~]$ runmqsc -n
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting local MQSC for 'AMQCLCHL.TAB'.

dis chl(*)
     1 : dis chl(*)
AMQ9518E: File '/var/mqm/AMQCLCHL.TAB' not found.
end
     2 : end
No commands have a syntax error.
[mqm@ip-172-31-14-154 ~]$ 

This is when try to read a channel tab if the file diesnot exist . Let's create one .refer below

[mqm@ip-172-31-14-154 ~]$ runmqsc -n
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting local MQSC for 'AMQCLCHL.TAB'.


DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
     1 : DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
AMQ8014I: IBM MQ channel created.
dis chl(*)
     2 : dis chl(*)
AMQ8414I: Display Channel details.
   CHANNEL(CL.APPQM1)                      CHLTYPE(CLNTCONN)
dis chl(*) all
     3 : dis chl(*) all
AMQ8414I: Display Channel details.
   CHANNEL(CL.APPQM1)                      CHLTYPE(CLNTCONN)
   AFFINITY(PREFERRED)                     ALTDATE(2021-01-10)
   ALTTIME(05.53.51)                       CERTLABL( )
   CLNTWGHT(0)                             COMPHDR(NONE)
   COMPMSG(NONE)                           CONNAME(172.31.14.154(1417))
   DEFRECON(NO)                            DESCR( )
   HBINT(300)                              KAINT(AUTO)
   LOCLADDR( )                             MAXMSGL(4194304)
   MODENAME( )                             PASSWORD( )
   QMNAME(APPQM1)                          RCVDATA( )
   RCVEXIT( )                              SCYDATA( )
   SCYEXIT( )                              SENDDATA( )
   SENDEXIT( )                             SHARECNV(10)
   SSLCIPH( )                              SSLPEER( )
   TPNAME( )                               TRPTYPE(TCP)
   USERID( )                            
end
     4 : end
One command has a syntax error.
[mqm@ip-172-31-14-154 ~]$ 

Now see the channel tab is created .

[mqm@ip-172-31-14-154 ~]$ ls -lrt /var/mqm/AMQCLCHL.TAB 
-rw-rw-r--. 1 mqm mqm 2106 Jan 10 05:53 /var/mqm/AMQCLCHL.TAB
[mqm@ip-172-31-14-154 ~]$ 

If you want to create in different location then we have to set MQCHLLIB.

For Windows:
SET MQCHLLIB=pathname
For UNIX and Linux systems:
export MQCHLLIB=pathname

Migration and client channel definition tables (CCDT)
In general, the internal format of the client channel definition table might change from one release level of IBM WebSphere MQ to the next. As a result, an IBM WebSphere MQ MQI client can use a client channel definition table only when it has been prepared by a server queue manager that is at the same release level as the client, or at an earlier release level.

If we generate a CHLTAB and try to use in Older version of client it may not work . Take the working TAB file and edit using runmqsc -n then modify then it should work fine .

Monday, August 5, 2019

Enable JMX on Weblogic and connect using visualVM

Every one have requirement to monitor the Weblogic performance in terms for Heap, GC, class loading ..etc during project development phase for performance stats /Load test results . As a part of this we will be seeing how we can enable JMX port in Weblogic and monitor each JVM for the details statics .

Please note there is some level of Monitoring available in Weblogic but that is instant value at that current point of time . We can not see the historical data for ex past 1 hour data . So enable JMX port on Weblogic and connect to Weblogic using tools like Jconsole,JVisualVM ,Java Machine control (JMC) using it core technology protocol . by having this we can do highly efficient performance tuning debugging tasks like flight recordings etc

Steps for enabling JMX is sam in Weblogic 10 ,11g ,12c, and 14c .

setDomainEnv.sh (or) setDomainEnv.cmd file can be found in the weblogic DOMAIN_HOME/bin directory to configure JVM arguments.

Unix – setDomainEnv.sh

JAVA_OPTIONS="${JAVA_OPTIONS}
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
export JAVA_OPTIONS


Windows – setDomainEnv.cmd

set JAVA_OPTIONS=%JAVA_OPTIONS%
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Add the above in the respective files and restart Weblogic .

setDomainEnv file is global and the parameter . so the port which is configure can be usable by only one JVM which ever starts first and other will get port conflicts . So We need to add different port for each JVM for this . Port can be anything available on the server.

As per my Experience there will be custom script defined for each JVM so better Add the above given JVM arguments individually for each JVM so that which ever JVM you want to connect can easily connect .

In other way you can add in setDomanEnv file with an if condition for each of you JVM like below . In your case JVM name's may be different .

JAVA_OPTIONS="${JAVA_OPTIONS}"
export JAVA_OPTIONS

if [ "$SERVER_NAME" == "AdminSer" ]
then
JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
export JAVA_OPTIONS

elif [ "$SERVER_NAME" == "AppSrv01" ]
then
JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11112 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
export JAVA_OPTIONS
fi

use jconsole hostname:port to connect from jconsoe

or double click jvisualVM and connect using IP and PORT without credentials .

Above is an insecure way of connecting . If you want to try in Highr environments then better use below

-Dcom.sun.management.jmxremote.password.file=jmxremote.password
-Dcom.sun.management.jmxremote.authenticate=true
Here we have used the access configuration files named jmxremote.access and jmxremote.password

jmxremote.access file
# The "monitor" role has readonly access.
# The "admin" role has readwrite access.
monitor readonly
admin readwrite
jmxremote.password file
# specify actual password instead of the text password
monitor password
admin password

Hope this help!!!

Tuesday, May 7, 2019

How to Setup IBM MQ Gateway QMGR

 A queue manager on which the interface queues are not located, but on which they are defined as cluster queues. Such a queue manager is called a gateway queue manager.

Sample Diagram for Gate Way QMGR

Created 3 QMGRS in TEST cluster

dis clusqmgr(*)
     2 : dis clusqmgr(*)
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(FR1)                           CHANNEL(TO.FR1)
   CLUSTER(TEST)                        
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(FR2)                           CHANNEL(TO.FR2)
   CLUSTER(TEST)                        
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(GWQM)                          CHANNEL(TO.GWQM)
   CLUSTER(TEST)                        

Here FR1 and FR2 actually hold the interface queue .Ex QL1
Application connecting to GRQM doenst hold the actual Queue but puts a message into an interface queue because the queue is not managed by GWQM .GWQM checks its cluster queue defninitions.It recognizes that QL1 is managed by FR1,Fr2 so GWQM puts the message to QL1 on one of the QMGR's (FR1,FR2). subsequent messages will be load balenced to FR1 and FR2

define ql(QL1) cluster(Test) defbind(notfixed)
Defined QL1 on Both FR1 and FR2

Sending 10 messages to QL1 using GWQM

bash-4.4$ cat put.sh 
 #!/bin/bash
 for i in `seq 10` ; do
  echo "Sending $i message"
  echo "Test MSG $i" |/opt/mqm/samp/bin/amqsput QL1 GWQM >/dev/null 2>&1
 done 
bash-4.4$

Verify the messages on FR1 QL1

bash-4.4$ /opt/mqm/samp/bin/amqsget QL1 FR1
Sample AMQSGET0 start
message <Test MSG 2>
message <Test MSG 4>
message <Test MSG 6>
message <Test MSG 8>
message <Test MSG 10>
no more messages
Sample AMQSGET0 end
bash-4.4$ 

Verify the messages on FR2 QL1

bash-4.4$ /opt/mqm/samp/bin/amqsget QL1 FR2
Sample AMQSGET0 start
message <Test MSG 1>
message <Test MSG 3>
message <Test MSG 5>
message <Test MSG 7>
message <Test MSG 9>
no more messages
Sample AMQSGET0 end
bash-4.4$ 

Messages can also be routed to a gateway queue manager from queue managers that are external to the cluster. Refer below Diagram .

Application have its own QMGR (non-cluster) and it connects to GWQM . If the Application side has another MQ cluster then GWQM will be used to OverLap two cluster's

Monday, April 1, 2019

MQ 9.2 Patching on Linux Server

 

Firstly download the latest fix pack from IBM site . In our case we are patching 9.2.0.1 on a Linux server . Follow below steps .

1.Upload the fix pack 9.2.0-IBM-MQ-LinuxX64-FP0001.tar.gz to server /tmp or any other directory where we have enough space .

2.If there are any QMGR's running .Bring down those .

endmqm -i QMGRName

3.Take the backup of /var/mqm directory where the QMGR data will be stored .

mq fixpack extraction

4.Install MQ fix pack

FP Contents
FP Installation

5.Verify MQ version to see the latest fix pack reflected.

List All the MQ installed packages 
[root@ip-172-31-14-154 FP]# rpm -qa |grep -i MQ
MQSeriesMsg_ja-9.2.0-0.x86_64
MQSeriesMsg_ru-9.2.0-0.x86_64
MQSeriesSDK-9.2.0-0.x86_64
MQSeriesServer-U9201-9.2.0-1.x86_64
MQSeriesFTLogger-U9201-9.2.0-1.x86_64
MQSeriesXRService-U9201-9.2.0-1.x86_64
MQSeriesExplorer-U9201-9.2.0-1.x86_64
MQSeriesMsg_de-U9201-9.2.0-1.x86_64
MQSeriesMsg_it-U9201-9.2.0-1.x86_64
MQSeriesMsg_pt-U9201-9.2.0-1.x86_64
MQSeriesSamples-U9201-9.2.0-1.x86_64
MQSeriesJava-9.2.0-0.x86_64
MQSeriesFTAgent-9.2.0-0.x86_64
MQSeriesFTLogger-9.2.0-0.x86_64
MQSeriesFTTools-9.2.0-0.x86_64
MQSeriesMan-9.2.0-0.x86_64
MQSeriesMsg_fr-9.2.0-0.x86_64
MQSeriesMsg_it-9.2.0-0.x86_64
MQSeriesMsg_ko-9.2.0-0.x86_64
MQSeriesMsg_pt-9.2.0-0.x86_64
MQSeriesMsg_Zh_CN-9.2.0-0.x86_64
MQSeriesSamples-9.2.0-0.x86_64
MQSeriesRuntime-U9201-9.2.0-1.x86_64
MQSeriesJava-U9201-9.2.0-1.x86_64
MQSeriesFTBase-U9201-9.2.0-1.x86_64
MQSeriesFTService-U9201-9.2.0-1.x86_64
MQSeriesFTTools-U9201-9.2.0-1.x86_64
MQSeriesAMS-U9201-9.2.0-1.x86_64
MQSeriesBCBridge-U9201-9.2.0-1.x86_64
MQSeriesClient-U9201-9.2.0-1.x86_64
MQSeriesGSKit-U9201-9.2.0-1.x86_64
MQSeriesMsg_cs-U9201-9.2.0-1.x86_64
MQSeriesMsg_es-U9201-9.2.0-1.x86_64
MQSeriesMsg_hu-U9201-9.2.0-1.x86_64
MQSeriesMsg_ja-U9201-9.2.0-1.x86_64
MQSeriesMsg_pl-U9201-9.2.0-1.x86_64
MQSeriesMsg_ru-U9201-9.2.0-1.x86_64
MQSeriesMsg_Zh_TW-U9201-9.2.0-1.x86_64
MQSeriesSDK-U9201-9.2.0-1.x86_64
MQSeriesJRE-9.2.0-0.x86_64
MQSeriesFTBase-9.2.0-0.x86_64
MQSeriesServer-9.2.0-0.x86_64
MQSeriesFTService-9.2.0-0.x86_64
MQSeriesAMS-9.2.0-0.x86_64
MQSeriesWeb-9.2.0-0.x86_64
MQSeriesClient-9.2.0-0.x86_64
MQSeriesBCBridge-9.2.0-0.x86_64
MQSeriesExplorer-9.2.0-0.x86_64
MQSeriesMsg_cs-9.2.0-0.x86_64
MQSeriesMsg_es-9.2.0-0.x86_64
MQSeriesMsg_hu-9.2.0-0.x86_64
MQSeriesMsg_pl-9.2.0-0.x86_64
MQSeriesMsg_Zh_TW-9.2.0-0.x86_64
MQSeriesJRE-U9201-9.2.0-1.x86_64
MQSeriesFTAgent-U9201-9.2.0-1.x86_64
MQSeriesAMQP-U9201-9.2.0-1.x86_64
MQSeriesSFBridge-U9201-9.2.0-1.x86_64
MQSeriesMan-U9201-9.2.0-1.x86_64
MQSeriesMsg_fr-U9201-9.2.0-1.x86_64
MQSeriesMsg_ko-U9201-9.2.0-1.x86_64
MQSeriesMsg_Zh_CN-U9201-9.2.0-1.x86_64
MQSeriesWeb-U9201-9.2.0-1.x86_64
MQSeriesRuntime-9.2.0-0.x86_64
MQSeriesGSKit-9.2.0-0.x86_64
MQSeriesAMQP-9.2.0-0.x86_64
MQSeriesXRService-9.2.0-0.x86_64
MQSeriesSFBridge-9.2.0-0.x86_64
MQSeriesMsg_de-9.2.0-0.x86_64
[root@ip-172-31-14-154 FP]# 

After successful MQ fix pack we can bring up the QMGR's and verify the Application connectivity .

Featured

Weblogic Domain Migration

 In this blog we will see domain re-configuration which will be done as part of Weblogic migration from lower version to higher version [ Ex...