IBM Support

IT23793: FDC generated when calling "com.ibm.mq.MQDestination.get(MQMessage,MQGetMessageOptions)"

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • A message containing an MQHRF2 header and a message payload that
    has a format of MQSTR is put onto a queue.  The coded character
    set identifier (CCSID) field in the MQHRF2 header is set to
    1208, which indicates that the bytes contained within the
    message payload represent a string encoded using CCSID 1208.
    The bytes contained within the message payload contained the
    byte sequence:
    
      0xE2 0x80 0x99
    
    which is the valid UTF-8 character "RIGHT SINGLE QUOTATION MARK"
    (U+2019).
    
    The MQMD has defined within it a CCSID value of 819, meaning
    that the following header (the RFH2) used character data encoded
    in CCSID 819, meaning the following structure:
    
      MQMD.ccsid = 819
      RFH2.ccsid = 1208
      body = encoded in 1208
    
    
    When an IBM MQ classes for Java application calls the method:
    
      com.ibm.mq.MQDestination.get(MQMessage, MQGetMessageOptions)
    
    to get this message from a queue,  the method call completes
    without throwing an exception, however an FFDC containing the
    following information was also generated:
    
    *************************************************************
    Source Class     :- com.ibm.mq.MQMessage
    Source Method    :- readPropertiesRfh2()
    ProbeID          :- 1
    
                                          Data
                                          ----
    
    |   Description  :-  An unexpected error occurred while parsing
    the message properties RFH2 header
    |   Exception    :-  java.io.UnsupportedEncodingException:
    java.nio.charset.UnmappableCharacterException: Input length = 1
    *************************************************************
    
    When the method call completed, the "com.ibm.mq.MQMessage"
    object passed into the get(...) call was populated with message
    data, but the body of the message was corrupt.
    

Local fix

  • Alter the message putting application such that the MQMD.ccsid
    value used in the message matches the CCSID which the body of
    the message was encoded with.
    

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects users of the IBM MQ classes for Java who have
    applications that call one of the following methods:
    
    - MQDestination.get( MQMessage )
    - MQDestination.get( MQMessage, MQGetMessageOptions )
    - MQDestination.get( MQMessage, MQGetMessageOptions, int )
    
    to get messages that contain:
    
    - An MQHRF2 header.
    - And a message payload that has the format MQSTR.
    
    from either a queue or a topic.
    
    The issue affects messages of this form which have a specified
    MQMD.ccsid value which is different to the encoding CCSID of the
    message body.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    When an IBM MQ classes for Java application calls one of the
    following methods
    
    - MQDestination.get(MQMessage)
    - MQDestination.getMQMessage, MQGetMessageOptions)
    - MQDestination.get(MQMessage, MQGetMessageOptions, int)
    
    to get a message containing:
    
    - An MQMD.
    - An MQHRF2 header.
    - And a message payload that has the format MQSTR.
    
    from either a queue or a topic, the IBM MQ classes for Java will
    issue an MQGET API call to get a message from the specified
    destination.
    
    If a message is returned, the IBM MQ classes for Java will:
    
    - Store the MQHRF2 header as a byte array.
    - Decode the message payload using the CCSID field within the
    MQHRF2 header and store it as a "java.lang.String" object.
    
    The IBM MQ classes for Java will then perform some processing of
    the MQHRF2 header, removing any message properties if required.
    
    After this processing has been performed, the IBM MQ classes for
    Java re-encoded the MQHRF2 header using the CCSID specified in
    the CCSID field within the MQMD of the message.  However, the
    IBM MQ classes for Java also attempted to re-encode the message
    payload as a byte sequence using this same CCSID, rather than
    the CCSID originally contained with the MQHRF2 header of the
    message.
    
    If the message body contained a byte sequence that:
    
    - Could be successfully decoded using the CCSID specified in the
    MQHRF2 header of the message, using a
    "java.nio.charset.CharsetDecoder"
    - Could not be re-encoded into a byte sequence using the CCSID
    as specified within the MQMD, using a
    "java.nio.charset.CharsetEncoder" without an exception being
    thrown
    
    then the IBM MQ classes for Java would generate an FFDC
    containing the following information:
    
    *************************************************************
    Source Class     :- com.ibm.mq.MQMessage
    Source Method    :- readPropertiesRfh2()
    ProbeID          :- 1
    
                                          Data
                                          ----
    
    |   Description  :-  An unexpected error occurred while parsing
    the message properties RFH2 header
    |   Exception    :-  java.io.UnsupportedEncodingException:
    java.nio.charset.UnmappableCharacterException: Input length = 1
    *************************************************************
    
    However, the method that the application was using to get the
    message completed without error and returned an
    "com.ibm.mq.MQMessage" object.  As the attempt to rewrite the
    message payload into the MQMessage object had failed, the
    MQMessage object contained corrupted data and could not be
    processed correctly by the application.
    

Problem conclusion

  • Two changes have been made as a result of this APAR:
    
    Change 1:
    -------------
    The method:
    
    - MQHeaderList.write(DataOutput, int, int, boolean)
    
    used by the IBM MQ classes for Java to re-encode a message's
    headers and payload, has been updated so that, if the last
    header on the message has the Format field set to the value
    "MQSTR", then the CCSID specified in the CCSID field for that
    header is used to encode the payload into a byte sequence. This
    ensures that the same CCSID is used to:
    
    - Decode the byte sequence contained within the message payload
    into a String.
    - Re-encode the String back into a byte sequence.
    
    which will prevent any exceptions being thrown when the String
    is re-encoded.
    
    
    Change 2:
    -------------
    In addition to this, the IBM MQ classes for Java methods:
    
    - MQDestination.get(MQMessage).
    - MQDestination.getMQMessage, MQGetMessageOptions).
    - MQDestination.get(MQMessage, MQGetMessageOptions, int).
    
    have been updated to:
    
    - Throw an MQException containing reason code 2111
    ('MQRC_SOURCE_CCSID_ERROR') if the attempt to re-encode the
    message body using the CCSID specified by the CCSID field in the
    last header before the message body failed.
    
    - Throw an MQException containing reason code 2195
    ('MQRC_UNEXPECTED_ERROR') if the attempt to update the MQHRF2
    header on the message and rewrite the message body fails for any
    other reason.
    
    This will alert applications that have called one of these
    get(...) methods to the fact that there was an issue processing
    the message returned from the queue manager, and that the
    application should not attempt to process the message as it will
    be in an inconsistent state.  If the message was being consumed
    inside of a syncpoint, the application can then choose to
    rollback the syncpoint and put the message back onto the queue
    that it came from.
    
    Note that if an MQException containing reason code 2195 is
    thrown, an FFDC containing the following information:
    
    *************************************************************
    Source Class     :- com.ibm.mq.MQMessage
    Source Method    :- readPropertiesRfh2()
    ProbeID          :- 1
    
                                          Data
                                          ----
    
    |   Description  :-  An unexpected error occurred while parsing
    the message properties RFH2 header
    |   Exception    :-  <Exception details>
    *************************************************************
    
    will be generated.  The information in the FFDC will help IBM
    Support identify the root cause of the MQException.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v8.0       8.0.0.10
    v9.0 LTS   9.0.0.4
    
    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

    IT23793

  • Reported component name

    IBM MQ BASE MP

  • Reported component ID

    5724H7251

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-01-22

  • Closed date

    2018-03-15

  • Last modified date

    2018-06-21

  • 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

    IBM MQ BASE MP

  • Fixed component ID

    5724H7251

Applicable component levels

[{"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":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
21 June 2018