IBM Support

IT22677: MQ-JMS throws an java.lang.IllegalArgumentException: "Unmatched braces in the pattern."

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • An application is running within the WebSphere Application
    Server v7.0.0.41 environment, running in a Traditional Chinese
    (LANG=zh_TW) locale.
    
    When the application server starts up, an attempt is made to
    start a Listener Port which is configured to consume messages
    from an MQ Destination.  At the time of attempting to start the
    Listener Port, the queue manager which the Listener Port is
    attempting to connect to is switched off, so a failure to start
    the Listener Port is expected.
    
    However when the startup of the Listener Port fails, the
    following unexpected exception is output into the SystemOut.log:
    
    java.lang.IllegalArgumentException: Unmatched braces in the
    pattern.
    at java.text.MessageFormat.applyPattern
    at java.text.MessageFormat.<init>
    at
    com.ibm.msg.client.commonservices.j2se.NLSServices.embedInserts
    at com.ibm.msg.client.commonservices.j2se.NLSServices.getMessage
    at com.ibm.msg.client.commonservices.j2se.NLSServices.getMessage
    at com.ibm.msg.client.commonservices.nls.NLSServices.getMessage
    at com.ibm.msg.client.wmq.common.internal.Reason.createException
    at com.ibm.msg.client.wmq.internal.WMQConnection.<init>
    at com.ibm.msg.client.wmq.internal.WMQXAConnection.<init>
    at
    com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7
    ProviderConnection
    at
    com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProv
    iderConnection
    at
    com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createPr
    oviderXAConnection
    at
    com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXACo
    nnectionInternal
    at
    com.ibm.mq.jms.MQXAQueueConnectionFactory.createXAQueueConnectio
    n
    at com.ibm.ejs.jms.JMSManagedQueueConnection.createConnection
    at com.ibm.ejs.jms.JMSManagedConnection.<init>
    at com.ibm.ejs.jms.JMSManagedQueueConnection.<init>
    at
    com.ibm.ejs.jms.WMQJMSRAManagedConnectionFactory.createManagedCo
    nnection
    at
    com.ibm.ejs.jms.JMSManagedConnectionFactory.createManagedConnect
    ion
    at
    com.ibm.ejs.jms.WMQJMSRAManagedConnectionFactory.createManagedCo
    nnection
    at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper
    at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection
    at com.ibm.ejs.j2c.PoolManager.reserve
    at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper
    at com.ibm.ejs.j2c.ConnectionManager.allocateConnection
    at
    com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle.createQueueConne
    ction
    at com.ibm.ejs.jms.listener.MDBListenerImpl.createResources
    at com.ibm.ejs.jms.listener.MDBListenerImpl.internalStart
    at com.ibm.ejs.jms.listener.MDBListenerImpl.start
    at com.ibm.ejs.jms.listener.MDBListenerManagerImpl.start
    at com.ibm.ejs.jms.listener.MsgListenerPort.add
    at
    com.ibm.ejs.jms.listener.MDBListenerManagerImpl.startApplication
    MDBs
    at com.ibm.ejs.jms.listener.MDBListenerManagerImpl.stateChanged
    at com.ibm.ws.runtime.component.MessageListenerImpl.stateChanged
    ... ... ...
    
    which offers no easily consumable information as to the cause of
    the failure to start the Listener Port - that being that the
    queue manager was not available.
    

Local fix

  • Switch to an alternative locale (such as English), or operate in
    an environment where error messages from the WebSphere MQ
    classes for JMS are not going to be reported.
    

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    Users of the WebSphere MQ classes for Java/JMS v7.0.0.13 or
    v7.0.0.14.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    As part of the translation cycle for the WebSphere MQ v7.0.0.13
    fix pack, the message properties files used by WebSphere MQ
    classes for Java/JMS v7.0 were updated.
    
    WebSphere MQ classes for Java/JMS makes use of the Java provided
    class:
    
      java.util.Properties
    
    to load the message property files.  As per the specification
    for this class, the method:
    
      java.util.Properties.load(InputStream)
    
    requires that the .properties files use the ISO 8859-1 character
    encoding, such that each byte within the file represents a
    single Latin1 character.  Characters which are outside of this
    range should be represented as Unicode escape sequences.
    
    
    The translation cycle changed the encoding of the .properties
    files used by the WebSphere MQ classes for Java/JMS such that
    they were no longer Unicode escaped ISO 8859-1 character encoded
    files, and were instead native encoded.
    
    The consequence of this depended upon the interpretation of the
    byte sequences which were encoded in the files.  It could result
    in corrupt error messages being output in place of the expected
    format native language messages.  Alternatively as was the case
    with the Traditional Chinese (zh_TW) locale, it resulted in a
    new exception being output, which occurred during the looking up
    of the native language message.
    
    For example, if a JMS application attempts to connect to a queue
    manager, and the queue manager name specified did not match that
    of the queue manager which the connection was established too,
    you would expect to see an exception of the form:
    
    
    com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed
    to connect to queue manager 'INVALID_QM_NAME' with connection
    mode 'Client' and host name 'myhost.mydomain(1414)'. Check the
    queue manager is started and if running in client mode, check
    there is a listener running. Please see the linked exception for
    more information.
    at
    com.ibm.msg.client.wmq.common.internal.Reason.reasonToException
    at com.ibm.msg.client.wmq.common.internal.Reason.createException
    at com.ibm.msg.client.wmq.internal.WMQConnection.<init>
    at
    com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7Pr
    oviderConnection
    at
    com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProv
    iderConnection
    at
    com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConn
    ection
    at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection
    at com.ibm.mq.jms.MQConnectionFactory.createConnection
    at MyApplication.myTest
    Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call
    failed with compcode '2' ('MQCC_FAILED') reason '2058'
    ('MQRC_Q_MGR_NAME_ERROR').
    at com.ibm.msg.client.wmq.common.internal.Reason.createException
    ... 8 more
    
    
    This contains the MQ return code MQRC 2058, and a message to
    indicate that the queue manager name which was used to connect
    to the queue manager did not match the connect to queue manager
    manager's name.
    
    
    If this same application is run with the WebSphere MQ classes
    for JMS v7.0.1.13 classes, running on a system with the locale
    set to Traditional Chinese (LANG=zh_TW), the following exception
    is thrown:
    
    java.lang.IllegalArgumentException: Unmatched braces in the
    pattern.
    at java.text.MessageFormat.applyPattern
    at java.text.MessageFormat.<init>
    at
    com.ibm.msg.client.commonservices.j2se.NLSServices.embedInserts
    at com.ibm.msg.client.commonservices.j2se.NLSServices.getMessage
    at com.ibm.msg.client.commonservices.j2se.NLSServices.getMessage
    at com.ibm.msg.client.commonservices.nls.NLSServices.getMessage
    at com.ibm.msg.client.wmq.common.internal.Reason.createException
    at com.ibm.msg.client.wmq.internal.WMQConnection.<init>
    at
    com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7Pr
    oviderConnection
    at
    com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProv
    iderConnection
    at
    com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConn
    ection
    at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection
    at com.ibm.mq.jms.MQConnectionFactory.createConnection
    at MyApplication.myTest
    
    which provides no information as to the MQ queue manager name
    problem which had occurred.
    

Problem conclusion

  • The WebSphere MQ build process was updated to convert the native
    encoded .properties files into ISO 8859-1 Unicode escaped files,
    which results in the appropriate messages being output when, for
    example, an exception is thrown by the WebSphere MQ classes for
    Java/JMS.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v7.0       7.0.1.15
    
    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

    IT22677

  • Reported component name

    WMQ WINDOWS V7

  • Reported component ID

    5724H7220

  • Reported release

    701

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-10-05

  • Closed date

    2018-02-27

  • Last modified date

    2018-02-27

  • 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 WINDOWS V7

  • Fixed component ID

    5724H7220

Applicable component levels

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSDEZSF","label":"IBM WebSphere MQ Managed File Transfer for z\/OS"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
31 March 2023