IBM Support

PI59436: NullPointerException when using EL expressions returning null

Fixes are available

16.0.0.2: WebSphere Application Server Liberty 16.0.0.2
16.0.0.3: WebSphere Application Server Liberty 16.0.0.3
16.0.0.4: WebSphere Application Server Liberty 16.0.0.4
17.0.0.1: WebSphere Application Server Liberty 17.0.0.1
17.0.0.2: WebSphere Application Server Liberty 17.0.0.2
17.0.0.3: WebSphere Application Server Liberty 17.0.0.3
17.0.0.4: WebSphere Application Server Liberty 17.0.0.4
18.0.0.1: WebSphere Application Server Liberty 18.0.0.1
18.0.0.2: WebSphere Application Server Liberty 18.0.0.2
18.0.0.3: WebSphere Application Server Liberty 18.0.0.3
18.0.0.4: WebSphere Application Server Liberty 18.0.0.4
19.0.0.1: WebSphere Application Server Liberty 19.0.0.1
19.0.0.2: WebSphere Application Server Liberty 19.0.0.2
19.0.0.3: WebSphere Application Server Liberty 19.0.0.3
19.0.0.4: WebSphere Application Server Liberty 19.0.0.4
19.0.0.5: WebSphere Application Server Liberty 19.0.0.5
19.0.0.6: WebSphere Application Server Liberty 19.0.0.6
19.0.0.7: WebSphere Application Server Liberty 19.0.0.7
19.0.0.8: WebSphere Application Server Liberty 19.0.0.8
19.0.0.9: WebSphere Application Server Liberty 19.0.0.9
19.0.0.10: WebSphere Application Server Liberty 19.0.0.10
19.0.0.11: WebSphere Application Server Liberty 19.0.0.11
19.0.0.12: WebSphere Application Server Liberty 19.0.0.12
20.0.0.1: WebSphere Application Server Liberty 20.0.0.1
20.0.0.2: WebSphere Application Server Liberty 20.0.0.2
20.0.0.3: WebSphere Application Server Liberty 20.0.0.3
20.0.0.4: WebSphere Application Server Liberty 20.0.0.4
20.0.0.5: WebSphere Application Server Liberty 20.0.0.5
20.0.0.6: WebSphere Application Server Liberty 20.0.0.6
20.0.0.7: WebSphere Application Server Liberty 20.0.0.7
20.0.0.8: WebSphere Application Server Liberty 20.0.0.8
20.0.0.9: WebSphere Application Server Liberty 20.0.0.9
20.0.0.10: WebSphere Application Server Liberty 20.0.0.10
20.0.0.11: WebSphere Application Server Liberty 20.0.0.11
20.0.0.12: WebSphere Application Server Liberty 20.0.0.12

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Using an EL expression as the value of a tag parameter
    expecting a primitive type could cause a
    java.lang.NullPointerException if the value of the
    expression is null in EL 3.0.
    
    The following generates a NPE:
    
    <c:if test="${doesNotExist}"> Inside if </c:if>
    
    The translated JSP snippet looks like:
    
    _jspx_th_c_if_0.setTest(((java.lang.Boolean)
    org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluat
    e("${doesNotExist}", java.lang.Boolean.class,
    (PageContext)pageContext, _jspx_fnmap,
    false)).booleanValue());
    
    Method proprietaryEvaluate in EL 3.0 will return null in
    this case. To solve this the generated JSP should look like
    this:
    
    _jspx_th_c_if_0.setTest(((java.lang.Boolean)
    org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluat
    e("${doesNotExist}", boolean.class,
    (PageContext)pageContext, _jspx_fnmap,
    false)).booleanValue());
    
    Notice the boolean.class primitive as the second argument of
    proprietaryEvaluate. In EL 3.0 this returns false when
    doesNotExist is not set.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty - JavaServer Pages (JSP)     *
    *                  2.3                                         *
    ****************************************************************
    * PROBLEM DESCRIPTION: A java.lang.NullPointerException is     *
    *                      thrown when using Expression Language   *
    *                      (EL) expressions returning null as the  *
    *                      value of a tag attribute expecting a    *
    *                      primitive type                          *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When using an EL expression as the value of a tag attribute
    expecting a primitive type, a java.lang.NullPointerException
    will be thrown if the EL expression returns null under the EL
    3.0 coercion rules. The following example will throw a
    java.lang.NullPointerException:
    
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"
    %>
    <html>
        <body>
        **${unsetVariable}**
        <c:if test="${unsetVariable}">
            Inside if.
        </c:if>
        </body>
    </html>
    

Problem conclusion

  • The JSP engine was modified to obtain the correct value of an EL
    expression of a primitive type, avoiding the
    java.lang.NullPointerException.
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack 16.0.0.2.  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

    PI59436

  • 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

    2016-03-18

  • Closed date

    2016-04-27

  • Last modified date

    2016-06-13

  • 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":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
16 October 2021