IBM Support

IT13141: JAVA APPLICATION THROWS FILENOTFOUNDEXCEPTION WHEN RUNNING UNDER THE SECURITY MANAGER

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • An IBM MQ v8 classes for Java application receives the following
    Java exception when running under the Java Security Manager:
    
    Exception in thread "main" java.lang.ExceptionInInitializerError
        at
    java.lang.J9VMInternals.ensureError(J9VMInternals.java:134)
        at
    java.lang.J9VMInternals.recordInitializationFailure(J9VMInternal
    s.java:123)
        at
    com.ibm.mq.jmqi.JmqiEnvironment.getJmqiCodepage(JmqiEnvironment.
    java:294)
        at
    com.ibm.mq.jmqi.JmqiEnvironment.lookupDefaultCharset(JmqiEnviron
    ment.java:361)
        at
    com.ibm.mq.jmqi.JmqiEnvironment.<init>(JmqiEnvironment.java:262)
        at
    com.ibm.mq.jmqi.system.JmqiSystemEnvironment.<init>(JmqiSystemEn
    vironment.java:76)
        at
    com.ibm.mq.jmqi.JmqiFactory.getInstance(JmqiFactory.java:122)
        at
    com.ibm.mq.internal.MQCommonServices.<clinit>(MQCommonServices.j
    ava:146)
        at com.ibm.mq.MQSESSION.getJmqiEnv(MQSESSION.java:141)
        at
    com.ibm.mq.MQSimpleConnectionManager.<init>(MQSimpleConnectionMa
    nager.java:95)
        at com.ibm.mq.MQEnvironment.<clinit>(MQEnvironment.java:569)
        ...
    Caused by: java.lang.RuntimeException:
    java.io.FileNotFoundException: META-INF/ccsid_merged.map
        at
    com.ibm.mq.jmqi.system.JmqiCodepage.<clinit>(JmqiCodepage.java:2
    63)
        ... 10 more
    Caused by: java.io.FileNotFoundException:
    META-INF/ccsid_merged.map
        at
    com.ibm.mq.jmqi.system.JmqiCodepage$JmqiCodepageFactory.<init>(J
    mqiCodepage.java:97)
        at
    com.ibm.mq.jmqi.system.JmqiCodepage.<clinit>(JmqiCodepage.java:2
    59)
        ... 10 more
    
    The Java Security Manager policy file has been configured with
    the following security permission:
    
    permission java.io.FilePermission
    "MQ_INSTALLATION_PATH/java/lib/-","read";
    
    for the IBM MQ v8 Java client jar files to allow manifest and
    other files to be read from the jar files within the
    installation directory.
    

Local fix

  • Add the following to the Java Security Manager Policy file:
    
    grant {
      permission java.io.FilePermission
        "MQ_INSTALLATION_PATH/java/lib/com.ibm.mq.jmqi.jar",
        "read";
    };
    
    or, if the application is using the com.ibm.mq.allclient.jar:
    
    grant {
      permission java.io.FilePermission
        "MQ_INSTALLATION_PATH/java/lib/com.ibm.mq.allclient.jar",
        "read";
    };
    

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects users of the IBM MQ v8 classes for Java who
    run applications under the Java Security Manager.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    The IBM MQ v8 classes for Java contain some internal
    configuration files within the jar files that are read when
    classes are initialised for the first time in the JVM.  One such
    file is the "ccsid_merged.map" which contains Java code page to
    IBM MQ CCSID mapping information.
    
    When attempting to obtain an InputStream to this file, the calls
    were not made inside an appropriate
    AccessController.doPrivileged block. As a result of this, if the
    IBM MQ classes for Java application was running inside of a Java
    Runtime Environment that had the Java security manager enabled,
    the InputStream would be null.  This then caused a nested
    java.io.FileNotFoundException to be thrown to the application.
    

Problem conclusion

  • The IBM MQ v8 classes for Java have been updated to ensure that
    the attempt to obtain an InputStream to read the
    "ccsid_merged.map" file is performed inside
    AccessController.doPrivileged block.
    
    The issue does not affect the IBM MQ v8 classes for JMS because
    the code path already wraps the reading of the
    "ccsid_merged.map" file within an AccessController.doPrivileged
    block.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v8.0       8.0.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

    IT13141

  • Reported component name

    WMQ BASE MULTIP

  • Reported component ID

    5724H7251

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-01-12

  • Closed date

    2016-02-23

  • Last modified date

    2016-07-30

  • 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

    5724H7251

Applicable component levels

  • R800 PSY

       UP

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

Document Information

Modified date:
30 July 2016