IBM Support

IT42506: MQ classes for Jakarta application throws an AssertionError using the Connection/Session toString()

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A MQ classes for Jakarta Messaging v9.3.1 CD application is
    running in a JVM with the 'enableassertions' flag enabled,
    enabled by either of the following JVM arguments:
    
      -enableassertions
      -ea
    
    The application calls the 'toString' method on the MQ classes
    for Jakarta Messaging Connection of Session objects, and an
    AssertionError exception is thrown back to the calling
    application, for example as follows:
    
    Exception in thread "main" java.lang.AssertionError
        at
    com.ibm.msg.client.jakarta.wmq.common.internal.WMQPropertyContex
    t.getStringProperty(WMQPropertyContext.java:390)
        at
    com.ibm.msg.client.jakarta.wmq.common.internal.StringablePropert
    y.resolve(StringableProperty.java:137)
        at
    com.ibm.msg.client.jakarta.wmq.common.internal.StringablePropert
    y.jsonIfy(StringableProperty.java:129)
        at
    com.ibm.msg.client.jakarta.wmq.internal.WMQConnection.toJson(WMQ
    Connection.java:2756)
        at
    com.ibm.msg.client.jakarta.jms.internal.JmsConnectionImpl.toJson
    (JmsConnectionImpl.java:2787)
        at
    com.ibm.mq.jakarta.jms.MQConnection.toString(MQConnection.java:5
    16)
        at myApplication.myMethod
    

Local fix

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    Users of the IBM MQ classes for Jakarta Messaging and IBM MQ
    classes for JMS v9.3.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    When an IBM MQ classes for JMS or IBM MQ classes for Jakarta
    Messaging using the MQ v9.3 code calls any of the methods:
    
    com.ibm.mq.jms.MQConnection.toString();
    com.ibm.mq.jms.MQSession.toString();
    com.ibm.mq.jakarta.jms.MQConnection.toString();
    com.ibm.mq.jakarta.jms.MQSession.toString();
    
    and the JVM is running with Java Assertions enable, for example
    by using the JVM argument:
    
      -enableassertions
    
    an AssertionError exception will be thrown by the method.
    
    For example, when using the MQ classes for JMS with Java
    assertions enabled, when the application calls the method:
    
    com.ibm.mq.jms.MQSesssion.toString();
    
    the following exception is thrown back to the application:
    
    java -enableassertions -cp
    /opt/mqm/java/lib/com.ibm.mq.allclient.jar:$PWD AssertionsCheck
    
    Exception in thread "main" java.lang.AssertionError
        at
    com.ibm.msg.client.wmq.common.internal.WMQPropertyContext.getStr
    ingProperty(WMQPropertyContext.java:390)
        at
    com.ibm.msg.client.wmq.common.internal.StringableProperty.resolv
    e(StringableProperty.java:137)
        at
    com.ibm.msg.client.wmq.common.internal.StringableProperty.jsonIf
    y(StringableProperty.java:129)
        at
    com.ibm.msg.client.wmq.internal.WMQSession.toJson(WMQSession.jav
    a:2162)
        at
    com.ibm.msg.client.jms.internal.JmsSessionImpl.toJson(JmsSession
    Impl.java:6097)
        at com.ibm.mq.jms.MQSession.toString(MQSession.java:1476)
        at AssertionsCheck.startTest(AssertionsCheck.java:86)
        at AssertionsCheck.main(AssertionsCheck:65)
    

Problem conclusion

  • The assert check has been removed from the IBM MQ classes for
    JMS/IBM MQ classes for Jakarta Messaging, so that the issue is
    no longer seen.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v9.2 LTS   9.2.0.25
    v9.3 LTS   9.3.0.20
    v9.x CD    9.3.3
    
    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

    IT42506

  • Reported component name

    MQ BASE V9.3

  • Reported component ID

    5724H7291

  • Reported release

    931

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2022-11-17

  • Closed date

    2022-11-24

  • Last modified date

    2024-02-26

  • 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":"931","Line of Business":{"code":"LOB67","label":"IT Automation \u0026 App Modernization"}}]

Document Information

Modified date:
26 February 2024