IBM Support

IT30668: IBM MQ Classes for Java/JMS trace is not produced if an invalid character in the trace output filename is used

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 IBM MQ classes for JMS application is running on the Windows
    operating system using the following JVM arguments:
    
      -Dcom.ibm.msg.client.commonservices.trace.status=ON
    
    -Dcom.ibm.msg.client.commonservices.trace.outputName=C:\temp\inv
    alid:filename.trc
    
    It is expected that due to the use of the invalid output
    filename (a colon character ':' is not permitted on the Windows
    operating system in the filename), trace from the IBM MQ classes
    for JMS would be directed to the Standard Error stream (stderr).
    
    However, no trace is produced at all.
    

Local fix

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects users of the IBM MQ classes for Java/JMS API
    who are attempting to enable trace for the client application,
    and specifying a trace filename which contains invalid
    characters for the operating system which the Java Virtual
    Machine (JVM) is running on.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    One mechanism to enable trace of the IBM MQ classes for
    Java/JMS, where the trace is directed to a specified location,
    is to start the JVM with the following arguments:
    
      -Dcom.ibm.msg.client.commonservices.trace.status=ON
    
    -Dcom.ibm.msg.client.commonservices.trace.outputName="traceOutpu
    tName"
    
    
    If a trace output location is specified which is invalid, for
    example on Linux if the user does not have permission to create
    the file using the arguments:
    
      -Dcom.ibm.msg.client.commonservices.trace.status=ON
    
    -Dcom.ibm.msg.client.commonservices.trace.outputName="/non/writa
    ble/location.trc"
    
    then the trace is redirected to the standard error stream
    (STDERR), with a message directed to the standard out stream
    (STDOUT) of the form:
    
    The IBM MQ messaging client trace mechanism could not initialize
    the trace file 'mqjavaclient_2084.trc' due to the exception
    'java.io.IOException: The IBM MQ messaging client trace
    mechanism does not have permission to write to the trace file
    '/non/writable/location.trc' in the directory '/non/writable''.
    Trace will be written to System.Err.
    
    
    However, if the trace name contained characters which were not
    valid for the path name on the operating system, trace would not
    be directed to STDERR, and would not be generated at all.
    
    For example, on the Windows platform, the colon ':' character is
    not valid for a filename.  If the user specified the JVM
    arguments:
    
      -Dcom.ibm.msg.client.commonservices.trace.status=ON
    
    -Dcom.ibm.msg.client.commonservices.trace.outputName="C:\temp\ba
    d:filename.trc"
    
    then no trace is generated at all.
    

Problem conclusion

  • The IBM MQ classes for Java/JMS trace mechanism opens the trace
    file for output using the Java constructor:
    
    java.util.logging.FileHandler(String, int, int, boolean)
    
    where the "String" argument represents the pattern for naming
    the output trace file.
    
    This constructor will throw an unchecked exception:
    
        java.nio.file.InvalidPathException
    
    if the specified filename cannot be converted into a
    "java.nio.file.Path" object because the string contains invalid
    characters.
    
    
    The IBM MQ Classes for Java/JMS were not catching this
    "java.nio.file.InvalidPathException", and as a result if it was
    thrown it would prevent trace from being redirected to STDERR -
    and trace would not be output.
    
    
    The IBM MQ classes for Java/JMS has now been updated to catch
    this unchecked "java.nio.file.InvalidPathException", and
    redirect the trace output to STDERR in the same way as if the
    specified file location could not be written to.
    
    If this occurs, then the explanation sent to STDOUT will be of
    the form:
    
    "The IBM MQ messaging client trace mechanism could not
    initialize the trace file due to the exception
    'java.nio.file.InvalidPathException'. Trace will be written to
    System.Err."
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v8.0       8.0.0.14
    v9.0 LTS   9.0.0.9
    v9.1 CD    9.1.5
    v9.1 LTS   9.1.0.5
    
    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

    IT30668

  • Reported component name

    MQ APPLIANCE M2

  • Reported component ID

    5737H4700

  • Reported release

    910

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-10-22

  • Closed date

    2019-11-28

  • Last modified date

    2020-01-06

  • 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 APPLIANCE M2

  • Fixed component ID

    5737H4700

Applicable component levels

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SS5K6E","label":"IBM MQ Appliance"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"910","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
06 January 2020