Troubleshooting
Problem
Cause
Resolving The Problem
- IBM MQ Queue Managers and Native Applications
- IBM MQ Java™ and JMS Applications
- IBM MQ Components and Telemetry
- IBM MQ Network Communications
- IBM MQ and Other Products
IBM MQ Queue Managers and Applications
These instructions explain how to trace the queue manager as well as native MQI client and server applications written in C, C++, COBOL, .NET, pTAL, RPG and Visual Basic.
Linux, UNIX, Windows and IBM i
HP NonStop Server and HP OpenVMS
IBM z/VSE
IBM MQ Java Message Service (JMS) and Java Applications
These instructions explain how to trace applications using the MQ classes for Java Message Service (JMS), whether they are running in WebSphere Application Server, in another Java EE application server, or in Java SE environments. Tracing instructions are also provided for applications using the MQ classes for Java, sometimes called the base Java classes, which are intended for Java SE environments but may be used in Java EE environments subject to several important restrictions.
WebSphere Application Server
Java SE Environments
IBM MQ Components
These instructions explain how to trace IBM MQ components such as Managed File Transfer (formerly File Transfer Edition), the MQ Explorer on Linux and Windows systems, and MQ Telemetry.
- MQ Managed File Transfer and File Transfer Edition trace
- MQ Managed File Transfer Agent trace on 4690 OS
- MQ Explorer trace
- MQ Telemetry trace
IBM MQ Network Communications
These instructions provide instructions for advanced tracing of IBM MQ network communications. These techniques may be used in addition to, or in place of, standard MQ traces based on the advice of IBM support.
- MQ line trace using amqrdbgm
- Setting a SLIP on an MQ message to capture packet trace and CTRACE on z/OS
IBM MQ and Other Products
These instructions provide instructions for tracing other products with which IBM MQ interacts.
- IBM Integration Bus trace
- WebSphere Message Broker trace
- Service Integration Bus trace
- WebSphere MQ Everyplace
- IMS trace on z/OS
WebSphere MQ V6.0 Standalone JMS Trace
Follow the instructions below to start, stop and format JMS trace in V6 and V7 for standalone (Java SE) applications.
NOTE: This method is still available in V7, but it is deprecated. It is suggested to use the new JMS trace facilities introduced in V7. See next section.
- Start trace:
WebSphere MQ JMS applications normally invoke trace by using command line arguments to the 'java' command. For example: - java -DMQJMS_TRACE_LEVEL=base -DMQJMS_TRACE_DIR=/tmp myApp
- Sometimes this is not possible and you may need to invoke trace from within the source code. This can be done as follows:
com.ibm.mq.jms.services.ConfigEnvironment.start("base");
...
com.ibm.mq.jms.services.ConfigEnvironment.stop();
- java.util.Properties pros = System.getProperties();
props.put("MQJMS_TRACE_DIR", "/tmp");
System.setProperties(props);
- java.util.Properties pros = System.getProperties();
- Format trace:
- Formatting is not required
WebSphere MQ V7.x Standalone JMS Trace
Follow the instructions below to start, stop and format JMS trace using the new features introduced in V7.
These trace instructions are for standalone (Java SE) applications that are not running under an application server.
==> Method 1: Using runtime tracing properties
- When invoking the application using the "java" program, include the properties com.ibm.msg.client.commonservices.trace.status and com.ibm.msg.client.commonservices.trace.outputName such as:
java -Djava.library.path="%MQ_JAVA_LIB_PATH%" -Dcom.ibm.msg.client.commonservices.trace.status=ON -Dcom.ibm.msg.client.commonservices.trace.outputName="%MQ_JAVA_DATA_PATH%"\trace ApplicationName
- The trace file defaults to a file named:
mqjms_PID.trc
... in the directory specified with com.ibm.msg.client.commonservices.trace.outputName, where PID is the current process ID.
If a process ID is not available, a random number is generated and prefixed with the letter f.
An example of using the full path for the outputName:
UNIX: com.ibm.msg.client.commonservices.trace.outputName=/var/mqm/trace/mqjms_%PID%.trc
==> Method 2: Using the JMS configuration file jms.config
If you want to use the JMS configuration file, you need to explicitly indicate it at runtime.
There is no default JMS configuration file.
- Locate the sample JMS configuration file: jms.config
Windows: C:\Program Files\IBM\WebSphere MQ\Java\bin.
UNIX platforms (except AIX): /opt/mqm/java/bin
AIX: /usr/mqm/java/bin.
- Copy this sample jms.config into a directory that is outside the MQ code directory structure and give it another name. For example:
UNIX: cp /opt/mqm/java/bin/jms.config /var/mqm/myjms.config
Note: ideally the original sample jms.config file should not be changed, to keep the philosophy that none of the files under the MQ code directory structure should be modified by the users.
- Modify the following property in your own copy of jms.config file to enable the tracing:
com.ibm.msg.client.commonservices.trace.status=ON
- Execute the JMS program using the property com.ibm.msg.client.config.location as follows:
java -Djava.library.path="%MQ_JAVA_LIB_PATH%" -Dcom.ibm.msg.client.config.location="file:/var/mqm/myjms.config" ApplicationName
- The trace file defaults to a file named:
mqjms_PID.trc
... in the current working directory where PID is the current process ID.
If a process ID is not available, a random number is generated and prefixed with the letter f.
Note: This assumes using the default value for the following property in the jms.config:
#com.ibm.msg.client.commonservices.trace.outputName=mqjms_%PID%.trc
If you want the trace file to be placed under /var/mqm/trace, then change the outputName property as follows:
com.ibm.msg.client.commonservices.trace.outputName=/var/mqm/trace/mqjms_%PID%.trc
- To turn tracing off, set the property to OFF:
com.ibm.msg.client.commonservices.trace.status=OFF
- Format trace:
Formatting is not required
- For more details of using the JMS configuration file for WebSphere MQ classes for JMS, see:
WebSphere MQ JCA Resource Adapter Trace
JCA Resource Adapter trace
For details on how to enable JCA Resource adapter trace, refer to the WebSphere MQ Using Java manual. The ra.xml file provided with the 6.0.2.1 resource adapter has these properties defined, so they just need editing to enable trace:
Note : MQ JMS/Java trace needs enabling as above, how this is done will depend on the application server in use. Two files will need collecting mqjms.trc from the JMS client, and the trace file created by the JCA RA.
WebSphere MQ JMS Trace for WebLogic Server V8.1
Inside this file are several lines which set the environment variable EXTRA_JAVA_PROPERTIES
export EXTRA_JAVA_PROPERTIES
EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dcom.ibm.msg.client.commonservices.trace.status=ON -Dcom.ibm.msg.client.commonservices.trace.outputName="%MQ_JAVA_DATA_PATH%"\trace"
export EXTRA_JAVA_PROPERTIES
EXTRA_JAVA_PROPERTIES="%EXTRA_JAVA_PROPERTIES% -Dcom.ibm.msg.client.commonservices.trace.status=ON -Dcom.ibm.msg.client.commonservices.trace.outputName="%MQ_JAVA_DATA_PATH%"\trace"
JAVA_PROPERTIES="${JAVA_PROPERTIES} ${EXTRA_JAVA_PROPERTIES}"
UNIX: com.ibm.msg.client.commonservices.trace.outputName=/var/mqm/trace/mqjms_%PID%.trc
==> Method 2: Using JMS configuration file jms.config
UNIX platforms (except AIX): /opt/mqm/java/bin
AIX: /usr/mqm/java/bin
UNIX: cp /opt/mqm/java/bin/jms.config /var/mqm/myjms.config
com.ibm.msg.client.commonservices.trace.status=ON
#com.ibm.msg.client.commonservices.trace.outputName=mqjava_%PID%.cl%u.trc
com.ibm.msg.client.commonservices.trace.outputName=/var/mqm/trace/mqjava_%PID%.cl%u.trc
EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} ...."
export EXTRA_JAVA_PROPERTIES
Unix:
EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dcom.ibm.msg.client.config.location=file:<path_to_your_copy_of_jms.config>/myjms.config"
EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dcom.ibm.msg.client.config.location=file:<path_to_your_copy_of_jms.config>\myjms.config"
JAVA_PROPERTIES="${JAVA_PROPERTIES} ${EXTRA_JAVA_PROPERTIES}"
com.ibm.msg.client.commonservices.trace.status
com.ibm.msg.client.commonservices.trace.status=OFF
** Note regarding SSL/TLS with WebLogic:
If you are using WebLogic, then you are using a non-IBM JRE and you will need to add:
-Djavax.net.debug=all
Product Synonym
WebSphere MQ WMQ
Was this topic helpful?
Document Information
Modified date:
04 December 2023
UID
swg21174924