IBM Support

IT46018: MQHeaderList.write() does not correctly format header(s) whencalled with a specific CCSID and a "raw" OutputStream.

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

  • An MQHeaderList (and therefore the MQHeader object(s) that it
    encapsulates) can be written to an MQMessage object. This is the
    typical use case. When MQHeaderList.write() is called in this
    way the MQMD (and the CCSID field it encapsulates) of the
    MQMessage is used to determine the character encoding of the
    message content.
    
    MQHeaderList.write() can also be called on a Java
    DataOutputStream object. This use case is typically utilised to
    "build" an MQMessage object from individual headers. When called
    in this manner the write() method is not correctly utilising the
    CCSID field on the write() method call. Instead it is treating
    the DataOutputStream as an MQMessage, attempting to read its
    MQMD (headers) and failing. When failing it resorts to using the
    platform specific default CCSID.
    
    This ultimately results in the underlying bytes being
    incorrectly encoded if the CCSID specified in the call to
    write() is not the same as the platform default.
    

Local fix

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects IBM MQ Java applications that are "building"
    messages specifying individual header(s) and calling
    MQHeaderList.write() to write those header(s) to an underlying
    DataOutputStream object.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    An MQHeaderList (and therefore the MQHeader object(s) that it
    encapsulates) can be written to an MQMessage object. This is the
    typical use case. When MQHeaderList.write() is called in this
    way the MQMD (and the CCSID field it encapsulates) of the
    MQMessage is used to determine the character encoding of the
    message content.
    
    MQHeaderList.write() can also be called on a Java
    DataOutputStream object (as opposed to the aforementioned
    MQMessage object). This use case is typically utilised to
    "build" an MQMessage object from individual headers. When called
    in this manner the write() method was not correctly utilising
    the CCSID field on the write() method call. Instead it treated
    the DataOutputStream as an MQMessage, attempting to read its
    MQMD and failing. This casued it to resort to using the platform
    specific default CCSID, rather than the one passed in on the
    write() call.
    
    Lets assume an example for the latter use case. For the sake of
    the below example accept that, at the time of this APAR
    publication, CCSID 1208 is synonymous with UTF-8 and CCSID 1390
    is synonymous with Japan EBCDIC and the byte representations may
    change.
    
    Running on a platform where the default CCSID is 1208, the
    application created a new MQHeader object of type MQIIH. The
    application now attempted to write this MQHeader (by calling
    MQHeaderList.write() after MQHeaderList.add()) with characters
    encoded in CCSID 1390.
    
    When the write() call returned, and the underlying
    DataOutputStream has been written to, looking at the bytes it
    could be seen that the character "I" was encoded as byte 0x49
    (as specified in 1208) instead of 0xC9 (as specified in 1390)
    and spaces were encoded as byte 0x20 (1208) instead of 0x40
    (1390).
    
    This meant that the underlying bytes, which would most likely be
    used to create an MQMessage object for transmission, contained
    incorrectly encoded bytes. This could cause unexpected behaviour
    on the receiving application.
    
    This APAR is applicable to any combination of supported CCSID's
    where MQHeaderList.write() is being called requesting a CCSID
    that is not the calling platforms' default.
    

Problem conclusion

  • Calling MQHeaderList.write() will now correctly write headers to
    underlying objects not of type MQMessage.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v9.3 LTS   9.3.0.25
    v9.4 LTS   9.4.0.5
    v9.x CD    9.4.1
    
    The latest available maintenance can be obtained from
    'IBM MQ Recommended Fixes'
    https://www.ibm.com/support/pages/recommended-fixes-ibm-mq
    
    If the maintenance level is not yet available information on
    its planned availability can be found in 'IBM MQ
    Planned Maintenance Release Dates'
    https://ibm.biz/mqplannedmaintenance
    
    ---------------------------------------------------------------
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT46018

  • Reported component name

    MQ BASE V9.3

  • Reported component ID

    5724H7291

  • Reported release

    930

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2024-04-25

  • Closed date

    2024-07-17

  • Last modified date

    2024-07-17

  • 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

    MQ BASE V9.3

  • Fixed component ID

    5724H7291

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.3","Line of Business":{"code":"LOB67","label":"IT Automation \u0026 App Modernization"}}]

Document Information

Modified date:
17 July 2024