IBM Support

IT43336: MQ classes for Java API throws MQRC 2111 'MQRC_SOURCE_CCSID_ERROR' when getting a message.

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

  • The MQ Explorer is being used to inspect messages on the dead
    letter queue.  Instead of browsing the message, the MQ Explorer
    displays the following error:
    
    The request received an unexpected reason code from an
    underlying API or command request. The reason code was 2111.
    (AMQ4048)
    Severity: 20 (Error)
    Explanation: While executing the requested operation, an
    unexpected return code was received. This has resulted in the
    operation not completing as expected.
    Response: Use the reason code to determine the underlying reason
    for the failure.
    
    
    Trace taken of the MQ Explorer attempting to browse the message
    shows the following exception being thrown:
    
    -1207697408
    java.io.UnsupportedEncodingException at:
    
    com.ibm.mq.jmqi.system.JmqiCodepage.getJmqiCodepage(JmqiCodepage
    .java:738)
    
    com.ibm.mq.jmqi.system.JmqiCodepage.getJmqiCodepage(JmqiCodepage
    .java:664)
      com.ibm.mq.headers.Charsets.convert(Charsets.java:163)
      com.ibm.mq.headers.Charsets.convert(Charsets.java:101)
    
    com.ibm.mq.headers.internal.store.MQMessageStore.getString(MQMes
    sageStore.java:267)
      com.ibm.mq.headers.MQRFH2.write(MQRFH2.java:299)
      com.ibm.mq.headers.MQHeaderList.write(MQHeaderList.java:717)
    
    com.ibm.mq.MQMessage$MQMessageHeaderList.write(MQMessage.java:24
    5)
      com.ibm.mq.MQMessage.readPropertiesRfh2(MQMessage.java:3845)
    
    com.ibm.mq.MQMessage.performProcessingAfterGet(MQMessage.java:33
    25)
      com.ibm.mq.MQDestination.getInt(MQDestination.java:701)
      com.ibm.mq.MQDestination.get(MQDestination.java:512)
    
    com.ibm.mq.explorer.messageplugin.internal.AccessMQ.browse(Acces
    sMQ.java:165)
    
    com.ibm.mq.explorer.messageplugin.internal.datamodel.MQBrowsesDa
    taModel.refresh(MQBrowsesDataModel.java:1289)
    
    com.ibm.mq.explorer.messageplugin.internal.BrowseDialog.refreshD
    ataModel(BrowseDialog.java:570)
    
    com.ibm.mq.explorer.messageplugin.internal.BrowseThread.run(Brow
    seThread.java:92)
    

Local fix

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    Users of the MQ classes for Java API.  This includes users of
    the MQ Explorer which utilises the MQ classes for Java to
    interact with the queue manager.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    When the MQ classes for Java API consumes a message from a queue
    (including browsing the message), if the message contains an
    MQRFH2 header, some manipulation of the MQRFH2 is performed
    before the message is returned to the application.
    
    This manipulation may result in all of the headers being
    re-written back into the:
    
      com.ibm.mq.MQMessage
    
    object.
    
    If the message contained multiple headers, where the first
    header was encoded in a different MQ encoding to the MQRFH2,
    then when the headers were being re-written back into the
    message the MQ classes for Java API incorrectly determined the
    numerical value for the MQRFH2 field:
    
      NameValueCCSID
    
    by using the wrong integer encoding to interpret the value.
    
    For example, consider a message on the queue with the following
    form:
    
      MQMD.encoding = 0x222
      MQDEAD.encoding = 0x111
      MQRFH2.encoding = 0x111
      Message Body
    
    This structure tells us that the dead letter header (MQDLH) is
    numerically encoded in little endian byte sequences, but the
    MQRFH2 is encoded in big-endian byte sequences. This is because
    each header details the encoding of the following header.
    
    If the NameValueCCSID field within the MQRFH2 contained the
    value '1208' (UTF-8), which has the hexidecimal representation
    of:
    
        00 00 04 B8
    
    when encoded in big-endian (what MQ refers to as 'normal
    encoding'), when this header structure was being re-written back
    into the MQMessage object, the MQ classes for Java API was
    interpreting this value using little-endian encoding (reversed
    encoding), which in Java would have the signed integer value:
    
      -1207697408 (B8 04 00 00)
    
    As this is not a recognised CCSID value, the MQ classes for Java
    would then fail the write operation when attempting to lookup
    the CCSID, with an exception of the form:
    
    java.io.UnsupportedEncodingException at:
    
    com.ibm.mq.jmqi.system.JmqiCodepage.getJmqiCodepage(JmqiCodepage
    .java:738)
    
    com.ibm.mq.jmqi.system.JmqiCodepage.getJmqiCodepage(JmqiCodepage
    .java:664)
      com.ibm.mq.headers.Charsets.convert(Charsets.java:163)
      com.ibm.mq.headers.Charsets.convert(Charsets.java:101)
    
    com.ibm.mq.headers.internal.store.MQMessageStore.getString(MQMes
    sageStore.java:267)
      com.ibm.mq.headers.MQRFH2.write(MQRFH2.java:299)
      com.ibm.mq.headers.MQHeaderList.write(MQHeaderList.java:717)
    
    com.ibm.mq.MQMessage$MQMessageHeaderList.write(MQMessage.java:24
    5)
      com.ibm.mq.MQMessage.readPropertiesRfh2(MQMessage.java:3845)
    
    com.ibm.mq.MQMessage.performProcessingAfterGet(MQMessage.java:33
    25)
      com.ibm.mq.MQDestination.getInt(MQDestination.java:701)
      com.ibm.mq.MQDestination.get(MQDestination.java:512)
    
    
    This exception was caught internally, and an exception of the
    following was returned to the application:
    
    com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason
    '2111'.
      at
    com.ibm.mq.MQMessage.readPropertiesRfh2(MQMessage.java:3865)
      at
    com.ibm.mq.MQMessage.performProcessingAfterGet(MQMessage.java:33
    23)
      at com.ibm.mq.MQDestination.getInt(MQDestination.java:701)
      at com.ibm.mq.MQDestination.get(MQDestination.java:452)
    

Problem conclusion

  • The MQ classes for Java API has been updated so that when
    re-writing an MQRFH2 header in a different encoding than it was
    originally encoded with, it will correctly interpret the value
    of the NameValueCCSID field.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v9.3 LTS   9.3.0.10
    v9.x CD    9.3.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

    IT43336

  • 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

    2023-03-13

  • Closed date

    2023-05-17

  • Last modified date

    2023-05-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":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.3","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
18 May 2023