MQException

 




java.lang.Object
   |
   *- java.lang.Throwable
           |
           *- java.lang.Exception
                   |
                   *- com.ibm.mq.MQException

public class MQException
extends Exception

An MQException is thrown whenever a WebSphere MQ error occurs. You can change the output stream for the exceptions that are logged by setting the value of MQException.log. The default value is System.err. This class contains definitions of completion code and error code constants. Constants beginning MQCC_ are WebSphere MQ completion codes, and constants beginning MQRC_ are WebSphere MQ reason codes. The WebSphere MQ Application Programming Reference contains a full description of these errors and their probable causes.

 

Variables

completionCode
public int completionCode

WebSphere MQ completion code giving rise to the error. The possible values are:

  • MQException.MQCC_WARNING

  • MQException.MQCC_FAILED

exceptionSource
public Object exceptionSource

The object instance that threw the exception. You can use this as part of your diagnostics when determining the cause of an error.

log
public static java.io.outputStreamWriter log

Stream to which exceptions are logged. (The default is System.err.) If you set this to null, no logging occurs.

reasonCode
public int reasonCode

WebSphere MQ reason code describing the error. For a full explanation of the reason codes, refer to the WebSphere MQ Application Programming Reference.

 

Constructors

MQException
public MQException(int completionCode,
                   int reasonCode,
                   Object source)

Construct a new MQException object.

Parameters

completionCode
The WebSphere MQ completion code.

reasonCode
The WebSphere MQ reason code.

source
The object in which the error occurred.

 

Methods

getCause
public Throwable getCause()

Returns the cause of this MQException, or null if the cause is nonexistent or unknown. Note that this method is available on MQException even under JVMs before Java 2 v1.4.

initCause
public Throwable initCause(Throwable cause)

Initializes the cause of this MQException to the specified value. Throws IllegalArgumentException if the cause is this MQException or IllegalStateException if the cause has already been set. Returns this MQException. Note that this method is available on MQException even under JVMs before Java 2 v1.4. Applications do not normally use this method.

 

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.