IBM Support

PI13291: NULLPOINTEREXCEPTION GENERATED WHEN TRYING TO GET A FILE WITH SPACES USING GETRESOURCEASSTREAM()

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Calling getResourceAsStream(java.lang.String) with a file that
    contains spaces results in a URISyntaxException followed by a
    java.lang.NullPointerException
    

Local fix

  • none available
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty Core                         *
    ****************************************************************
    * PROBLEM DESCRIPTION: Calling                                 *
    *                      getResourceAsStream(java.lang.String)   *
    *                      with a file that contains spaces        *
    *                      results in a URISyntaxException         *
    *                      followed by a                           *
    *                      java.lang.NullPointerException          *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    getResourceURL method of ArtifactEntryUniversalResource or
    EntryUniversalResource gets a NullPointerException when
    getResourceAsStream is called with a file name containing
    spaces.
    I FFDC1015I: An FFDC Incident has been created:
    "java.net.URISyntaxException: Illegal character in opaque part
    at index 211:
    wsjar:file:/C:/wlp/usr/servers/testClasspath_Server/workarea/org
    .eclipse.osgi/bundles/52/data/cache/com.ibm.ws.app.manager_15/.c
    ache/propertiesOnlyApp.war!/W A C.properties
    com.ibm.ws.artifact.zip.internal.ZipFileContainer 715" at
    ffdc_14.05.07_06.46.03.0.log
    E SRVE0777E: Exception thrown by application class
    'com.ibm.ws.classloading.internal.ContainerClassLoader$EntryUniv
    ersalResource.getResourceURL:219'
    java.lang.NullPointerException
    at
    com.ibm.ws.classloading.internal.ContainerClassLoader$EntryUnive
    rsalResource.getResourceURL(ContainerClassLoader.java:219)
    at
    com.ibm.ws.classloading.internal.ContainerClassLoader$SmartClass
    PathImpl.getResourceURL(ContainerClassLoader.java:865)
    at
    com.ibm.ws.classloading.internal.ContainerClassLoader.findResour
    ce(ContainerClassLoader.java:1376)
    at
    com.ibm.ws.classloading.internal.AppClassLoader.findResource(App
    ClassLoader.java:140)
    at
    java.lang.ClassLoader.getResource(ClassLoader.java:456)
    at
    java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:523)
    at
    com.ibm.test.ClasspathServlet.doGet(ClasspathServlet.java:57)
    

Problem conclusion

  • Changed the code to not get a URISyntaxException and
    NullPointerException when getResourceAsStream is called with a
    file name containing spaces.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 8.5.5.3. Please refer to the Recommended Updates page
    for delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI13291

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2014-03-07

  • Closed date

    2014-05-14

  • Last modified date

    2014-05-14

  • 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

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
28 April 2022