IBM Support

IT22246: NumberFormatException thrown by javax.jms.Message.getIntProperty(JmsConstants.JMS_IBM_PUTAPPLTYPE)

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 MQ classes for JMS application consumes a message where the
    "PutApplType" field in the MQMD of the consumed MQ message is
    set to the value:
    
      '0'  ('MQAT_NO_CONTEXT')
    
    
    When the application queries the value of the property:
    
      'JMS_IBM_PUTAPPLTYPE'
    
    on the JMS message object returned to the application, via a
    call to the method:
    
    
    javax.jms.Message.getIntProperty(JmsConstants.JMS_IBM_PUTAPPLTYP
    E);
    
    the following exception is thrown back to the application:
    
    java.lang.NumberFormatException: null value
    at
    com.ibm.msg.client.jms.internal.JmsReadablePropertyContextImpl.p
    arseInt
    at com.ibm.msg.client.jms.internal.JmsMessageImpl.getIntProperty
    at com.ibm.jms.JMSMessage.getIntProperty
    

Local fix

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects users of the:
    
      - WebSphere MQ V7.5 classes for JMS
      - IBM MQ V8 classes for JMS
      - IBM MQ V9 classes for JMS
    
      - WebSphere Application Server V9 MQ messaging provider
    
    who consume MQ messages that have been sent to their destination
    with the put message option MQPMO_NO_CONTEXT, such that the
    MQMD's PutApplType field of the message is set to the value
    MQAT_NO_CONTEXT (0), and who call:
    
      getIntProperty(JmsConstants.JMS_IBM_PUTAPPLTYPE)
    
    on the javax.jms.Message object returned to their application.
    
    
    Similarly, this issue also affects users of the Message Service
    Client for .NET XMS API.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    When an MQ message was consumed by the MQ classes for JMS API or
    the Message Service Client for .NET XMS API that had been put
    using the MQPMO option:
    
      MQPMO_NO_CONTEXT
    
    such that the PutApplType field of the MQMD for the message was
    set to the value MQAT_NO_CONTEXT, the JMS_IBM_PUTAPPLTYPE
    property:
    
    https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm
    .mq.javadoc.doc/WMQJMSClasses/com/ibm/msg/client/jms/JmsConstant
    s.html?view=kc#JMS_IBM_MQMD_PUTAPPLTYPE
    
    was not set on the javax.jms.Message object created from the MQ
    message.  As such, the JMS_IBM_PUTAPPLTYPE property had a null
    value.  This meant that when the application called:
    
      getIntProperty(JmsConstants.JMS_IBM_PUTAPPLTYPE);
    
    on the javax.jms.Message object, a
    java.lang.NumberFormatException was thrown as per section 3.5.4
    of the JMS specification because a Java 'null' value cannot be
    converted into a Java 'int' primitive.
    

Problem conclusion

  • The value MQAT_NO_CONTEXT (0) is a valid value for the
    PutApplType field of an MQ message's MQMD.  As such, this APAR
    updates the MQ classes for JMS and Message Service Client for
    .NET XMS APIs such that message objects will now have the
    JMS_IBM_PUTAPPLTYPE property set on them when an MQ message is
    consumed that has the value 0 in the MQMD PutApplType field.
    
    As a result, calling:
    
        getIntProperty(JmsConstants.JMS_IBM_PUTAPPLTYPE);
    
    on a javax.jms.Message object will return the int value 0, as
    opposed to throwing a java.lang.NumberFormatException.
    
    
    Note this will result in a change in behaviour for applications
    that call:
    
      getStringProperty(JmsConstants.JMS_IBM_PUTAPPLTYPE);
    
    Prior to this APAR, in the scenario described by the APAR
    closing text, the above method call would have returned a null
    object, as the JMS_IBM_PUTAPPLTYPE property would not have been
    set on the javax.jms.Message object.  After the code change
    associated with this APAR, the property will be set on the
    message object to the int value 0, which will be converted into
    the string, "0" when the method call:
    
      getStringProperty(JmsConstants.JMS_IBM_PUTAPPLTYPE)
    
    is made.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v7.5       7.5.0.9
    v8.0       8.0.0.8
    v9.0 CD    9.0.5
    v9.0 LTS   9.0.0.3
    
    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

    IT22246

  • Reported component name

    WMQ BASE MULTIP

  • Reported component ID

    5724H7241

  • Reported release

    750

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-09-01

  • Closed date

    2017-10-30

  • Last modified date

    2017-11-16

  • 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

    5724H7241

Applicable component levels

  • R750 PSY

       UP



Document information

More support for: WebSphere MQ
APAR / Maintenance

Software version: 7.5

Reference #: IT22246

Modified date: 16 November 2017


Translate this page: