IBM Support

How to obtain MQ classes for Java trace in WebSphere Application Server

Question & Answer


Question

You want to obtain the MQ classes for Java™ trace in WebSphere Application Server

Answer

Before using MQ classes for Java trace, you should consider this caveat about using MQ classes for Java on WebSphere Application Server: Using WebSphere MQ Java Interfaces in J2EE/JEE Environments
This technote explains why "WebSphere MQ classes for Java Message Service" is the API best suited for use in J2EE/JEE environments. It also describes the restrictions and design considerations that must be taken into account before using "WebSphere MQ classes for Java" in J2EE/JEE.



Follow these steps to obtain the MQ classes for Java trace in WebSphere Application Server:

1: Ensure to have at least one MQ JMS Administered Object in the WebSphere Application Server.
If you do not have such an object, follow this sequence to define one:

Using the WebSphere Application Server Administrative Console, create an MQ JMS Administered Object. We recommend to create a ConnectionFactory. This object does not need to be used, nor even have valid values.

A Connection Factory can be created as follows:
Resources -> JMS -> Connection factories -> New -> WebSphere MQ messaging provider

You need to supply any value for the 'Name' and 'JNDI name' fields, and click the 'OK' button at the bottom of the panel. Save the configuration.
Any time you create or modify a JMS object, you will need to restart the application server.
Do not restart it yet, because few more things need to be configured.

2: Setup the WAS JMS tracing string by following the instructions from the technote:

Enabling JMS trace for releases of WebSphere Application Server

The JMS tracing string should be set to:
*=info:JMSApi=all:JMSServer=all:Messaging=all:JMS_WASTraceAdapter=all:com.ibm.mq.*=all:jmsApi=all:ConnLeakLogic=all:com.ibm.ejs.j2c.*=all

3: Save the configuration changes.

4: Logoff from the Administrative Console.

5: Restart the Application Server for which trace has been enabled.

6: Ensure that the application that uses the MQ classes for Java is started. Do the appropriate action to connect to an MQ queue manager, or put/get a message, etc.

7: The trace.log should capture the tracing activity of the MQ classes for Java code. To check this, you can search the trace.log for the following string:
MQSESSION


Example:
The following entries show the version of the MQ classes for Java and a call to the MQQueueManager constructor for the queue manager QM1:
[31/01/24 17:15:17:440 GMT] 0000021b MQQueueManage >  static() (com.ibm.mq.MQQueueManager) [:/4de07647] Entry
                                 <null>
[31/01/24 17:15:17:442 GMT] 0000021b MQQueueManage 3   (com.ibm.mq.MQQueueManagerFactory) [:/d2059987] static: SCCS id
                                 @(#) MQMBID sn=p910-016-230602 su=_EyHPRQFIEe6SL8KfsXRgqA pn=com.ibm.mq/src/com/ibm/mq/MQQueueManagerFactory.java
[31/01/24 17:15:17:442 GMT] 0000021b MQJavaLevel   3   (com.ibm.mq.MQJavaLevel) [:/5a20bedc] static: SCCS id
                                 @(#) MQMBID sn=p910-016-230602 su=_EyHPRQFIEe6SL8KfsXRgqA pn=com.ibm.mq/src/com/ibm/mq/MQJavaLevel.java
[31/01/24 17:15:17:442 GMT] 0000021b MQJavaLevel   >  traceBuildInfo() (com.ibm.mq.MQJavaLevel) [:/5a20bedc] Entry
                                 <null>
[31/01/24 17:15:17:442 GMT] 0000021b MQJavaLevel   <  traceBuildInfo() (com.ibm.mq.MQJavaLevel) [:/5a20bedc] Exit
                                 <null>
[31/01/24 17:15:17:444 GMT] 0000021b MQSESSION     3   (com.ibm.mq.MQSESSION) [:/14334d42] static: SCCS id
                                 @(#) MQMBID sn=p910-016-230602 su=_EyHPRQFIEe6SL8KfsXRgqA pn=com.ibm.mq/src/com/ibm/mq/MQSESSION.java
[31/01/24 17:15:17:444 GMT] 0000021b MQSESSION     >  static() (com.ibm.mq.MQSESSION) [:/14334d42] Entry
                                 <null>
[31/01/24 17:15:17:444 GMT] 0000021b MQSESSION     <  static() (com.ibm.mq.MQSESSION) [:/14334d42] Exit
                                 <null>
......
[31/01/24 17:15:17:462 GMT] 0000021b MQQueueManage <  static() (com.ibm.mq.MQQueueManager) [:/4de07647] Exit
                                 <null>
......
[31/01/24 17:15:17:473 GMT] 0000021b MQQueueManage >  <init>(String,Hashtable) (com.ibm.mq.MQQueueManager) [:/4197b68b] Entry
                                 QM1
                                 {port=1414, hostname=localhost, channel=MY.SVRCONN, transport=MQSeries Bindings}

 
+ tags:
Author: Paul Titheridge
+++ end +++

[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Java","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.0;7.5;7.1;7.0.1;7.0;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java Message Service (JMS)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5;8.0;7.0;6.1","Edition":"","Line of Business":{"code":"LOB67","label":"IT Automation \u0026 App Modernization"}},{"Product":{"code":"SSYHRD","label":"IBM MQ"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB67","label":"IT Automation \u0026 App Modernization"}}]

Product Synonym

WMQ WebSphere MQ MQSeries; MQ Base Java

Document Information

Modified date:
01 March 2024

UID

swg21457855