IBM Support

PH14619: ServletContext.getRealPath() shouldn't return null for nonexistent files

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  Users of                                    *
    *                  javax.servlet.ServletContext.getRealPath(St *
    *                  ring) on WebSphere Liberty                  *
    ****************************************************************
    * PROBLEM DESCRIPTION: ServletContext.getRealPath(String       *
    *                      path)                                   *
    *                      returns null when no resource exists    *
    *                      for the path argument                   *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    WebSphere Liberty returns null when
    ServletContext.getRealPath(String path) is called with a path
    referencing a resource that does not exist. This behavior is
    inconsistent with traditional WebSphere, which returns a path
    even if no resource exists at the path.
    

Problem conclusion

  • Calls made on WebSphere Liberty to
    ServletContext.getRealPath(String path) will now return a
    translated path for the given path argument, even if no resource
    exists at that path. Note that if application autoExpand is
    disabled, then null will continue to be returned for all paths.
    
    A new WebContainer property has been added to control this
    behavior: com.ibm.ws.getRealPathReturnsQualifiedPath
    (true/false, default=true)  When getRealPathReturnsQualifiedPath
    is set to false, the previous behavior will be enabled - and
    null will once again be returned for paths at which no resource
    exists.
    
    This has been resolved in Open Liberty under issue #5035:
    https://github.com/OpenLiberty/open-liberty/issues/5035
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack 19.0.0.8.  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

    PH14619

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    CD0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-07-17

  • Closed date

    2019-07-29

  • Last modified date

    2021-08-04

  • 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

  • RCD0 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"CD0","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
15 October 2021