Solving problems

 


If a program does not complete successfully, run the installation verification program

 

Tracing programs

The WebSphere MQ JMS trace facility is provided to help IBM staff to diagnose customer problems.

Trace is disabled by default, because the output rapidly becomes large, and is unlikely to be of use in normal circumstances.

If you are asked to provide trace output, enable it by setting the Java property MQJMS_TRACE_LEVEL to one of the following values:

on
traces WebSphere MQ JMS calls only

base
traces both WebSphere MQ JMS calls and the underlying WebSphere MQ base Java calls

For example:

java -DMQJMS_TRACE_LEVEL=base MyJMSProg

To disable trace, set MQJMS_TRACE_LEVEL to off.

By default, trace is output to a file named mqjms.trc in the current working directory. You can redirect it to a different directory by using the Java property MQJMS_TRACE_DIR.

For example:

java -DMQJMS_TRACE_LEVEL=base -DMQJMS_TRACE_DIR=/somepath/tracedir MyJMSProg

The runjms utility script sets these properties by using the environment variables MQJMS_TRACE_LEVEL and MQ_JAVA_DATA_PATH, as follows:

java -DMQJMS_LOG_DIR=%MQ_JAVA_DATA_PATH%\log
-DMQJMS_TRACE_DIR=%MQ_JAVA_DATA_PATH%\trace
-DMQJMS_TRACE_LEVEL=%MQJMS_TRACE_LEVEL% %1 %2 %3 %4 %5 %6 %7 %8 %9

This is the default; change it as required.

 

Logging

The WebSphere MQ JMS log facility is provided to report serious problems, particularly those that might indicate configuration errors rather than programming errors. By default, log output is sent to the System.err stream, which usually appears on the stderr of the console in which the JVM is run.

You can redirect the output to a file by using a Java property that specifies the new location, for example:

java -DMQJMS_LOG_DIR=/mydir/forlogs MyJMSProg

The utility script runjms, in the bin directory of the WebSphere MQ JMS installation, sets this property to:

<MQ_JAVA_DATA_PATH>/log

where MQ_JAVA_DATA_PATH is set, on Windows systems, to the path to your WebSphere MQ Java installation. On other platforms you need to set this environment variable.

When the log is redirected to a file, it is output in a binary form. To view the log, the utility formatLog (formatLog.bat on Windows systems) is provided, which converts the file to plain text format. The utility is stored in the bin directory of your WebSphere MQ JMS installation. Run the conversion as follows:

formatLog <inputfile> <outputfile>

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.