IBM Support

IT10708: IBM MQ RC 2142 (MQRC_HEADER_ERROR) PUTTING AN MQMESSAGE MORE THAN ONCE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • After upgrading to the IBM MQ v8.0.0.1 classes for Java, the
    following exception is thrown to the application when the same
    MQMessage object is put to a queue or topic destination for a
    second time:
    
    com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason
    '2142'.
    at com.ibm.mq.MQMessage.writePropertiesRfh2(MQMessage.java:3277)
    at
    com.ibm.mq.MQMessage.performProcessingBeforePut(MQMessage.java:3
    125)
    at com.ibm.mq.MQDestination.put(MQDestination.java:1134)
    at com.ibm.mq.MQDestination.put(MQDestination.java:1067)
    ...
    Caused by: java.io.UnsupportedEncodingException:
    java.nio.charset.MalformedInputException: Input length = 1
    at
    com.ibm.mq.headers.MQHeaderIterator.getBodyAsText(MQHeaderIterat
    or.java:415)
    at
    com.ibm.mq.headers.MQHeaderIterator.getBody(MQHeaderIterator.jav
    a:356)
    at com.ibm.mq.headers.MQHeaderList.read(MQHeaderList.java:449)
    at com.ibm.mq.headers.MQHeaderList.read(MQHeaderList.java:355)
    at com.ibm.mq.headers.MQHeaderList.(MQHeaderList.java:176)
    at com.ibm.mq.MQMessage.writePropertiesRfh2(MQMessage.java:3265)
    

Local fix

  • Create a new MQMessage object for each MQQueue.put(...) or
    MQTopic.put(...) API call.
    

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects users of the IBM MQ classes for Java who do
    all of the following:
    
      1) create an MQMessage object
    
      2) set message properties on the MQMessage object, for example
    using the syntax:
              com.ibm.mq.MQMessage.setStringProperty("PropertyName",
    "Value");
    
      3) set the format property of the MQMessage to "MQSTR"
    
      4) use the writeString(java.lang.String) method from the
    class:
              com.ibm.mq.MQMessage
          and converts the text into bytes which are encoded in a
    character encoding scheme which is not compatible if interpreted
    using the CCSID 1208 encoding scheme.
    
    and attempt to send the MQMessage object more than once, to
    either the same or different destinations.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    When the method:
    
        com.ibm.mq.MQMessage.writeString(String)
    
    is used, the IBM MQ classes for Java write the specified
    java.lang.String into the message data buffer, converting it
    into bytes encoded using the scheme specified by the Coded
    Character Set Identifier (CCSID), as dictated by the
    "characterSet" property of the message. For the IBM MQ classes
    for Java, this defaults to CCSID 819 on distributed platforms,
    and CCSID 500 on z/OS.
    
    If properties are defined on the com.ibm.mq.MQMessage object,
    when the message is put to the destination the IBM MQ classes
    for Java creates an MQRFH2 header to store the message
    properties data, and updates the message data buffer associated
    with the com.ibm.mq.MQMessage. The character set of an MQRFH2
    header must be one that uses single-byte characters for the
    characters which are valid in queue names, for example CCSID
    1208. Due to MQ Header chaining, the format, encoding and CCSID
    fields of the MQMD for the message are updated to reference the
    MQRFH2 header that follows the MQMD. The MQRFH2 header then
    contains the format, encoding and CCSID information for the
    message body, assuming that it follows the MQRFH2 header.
    
    
    Once the put has completed, the message data buffer for the
    com.ibm.mq.MQMessage object is reset along with the format field
    of the MQMD. However the encoding and CCSID values were not
    being reset. The consequence of this was that when a subsequent
    put was requested, the IBM MQ classes for Java interpreted the
    message data buffer a second time, but reading the message
    payload in the CCSID 1208 encoding scheme because this was the
    reset value of the MQMD property "characterSet".
    
    If the message payload was converted using CCSID 500 when first
    written into the message data buffer, a
    java.nio.charset.MalformedInputException was likely to be thrown
    and returned to the application if any of the bytes encountered
    were not valid when using the CCSID 1208 encoding scheme. The
    exception thrown back to the application was of the form:
    
    com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason
    '2142'.
    at com.ibm.mq.MQMessage.writePropertiesRfh2(MQMessage.java:3277)
    at
    com.ibm.mq.MQMessage.performProcessingBeforePut(MQMessage.java:3
    125)
    at com.ibm.mq.MQDestination.put(MQDestination.java:1134)
    at com.ibm.mq.MQDestination.put(MQDestination.java:1067)
    ...
    Caused by: java.io.UnsupportedEncodingException:
    java.nio.charset.MalformedInputException: Input length = 1
    at
    com.ibm.mq.headers.MQHeaderIterator.getBodyAsText(MQHeaderIterat
    or.java:415)
    at
    com.ibm.mq.headers.MQHeaderIterator.getBody(MQHeaderIterator.jav
    a:356)
    at com.ibm.mq.headers.MQHeaderList.read(MQHeaderList.java:449)
    at com.ibm.mq.headers.MQHeaderList.read(MQHeaderList.java:355)
    at com.ibm.mq.headers.MQHeaderList.(MQHeaderList.java:176)
    at com.ibm.mq.MQMessage.writePropertiesRfh2(MQMessage.java:3265)
    
    
    and the message put did not succeed.
    

Problem conclusion

  • The IBM MQ classes for Java have been updated such that, after
    an com.ibm.mq.MQMessage object has been put to a destination,
    the message data buffer and the format, encoding and
    characterSet fields of the message are reset to the values prior
    to the put, and not the default values used by the classes.
    
    This permits subsequent puts to correctly decode the character
    data contained within the com.ibm.mq.MQMessage object.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v8.0       8.0.0.5
    
    The latest available maintenance can be obtained from
    'WebSphere MQ Recommended Fixes'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006037
    
    If the maintenance level is not yet available information on
    its planned availability can be found in 'WebSphere MQ
    Planned Maintenance Release Dates'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006309
    ---------------------------------------------------------------
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT10708

  • Reported component name

    WMQ BASE MULTIP

  • Reported component ID

    5724H7251

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2015-08-14

  • Closed date

    2015-10-30

  • Last modified date

    2015-10-30

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WMQ BASE MULTIP

  • Fixed component ID

    5724H7251

Applicable component levels

  • R800 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0.0.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
30 October 2015