IBM Support

PI73022: JSP comments containing "%>" might throw a StringIndexOutOfBoundsException.

Fixes are available

9.0.0.4: WebSphere Application Server traditional V9.0 Fix Pack 4
8.5.5.12: WebSphere Application Server V8.5.5 Fix Pack 12
9.0.0.5: WebSphere Application Server traditional V9.0 Fix Pack 5
8.0.0.14: WebSphere Application Server V8.0 Fix Pack 14
9.0.0.6: WebSphere Application Server traditional V9.0 Fix Pack 6
8.5.5.13: WebSphere Application Server V8.5.5 Fix Pack 13
9.0.0.7: WebSphere Application Server traditional V9.0 Fix Pack 7
17.0.0.1: WebSphere Application Server Liberty 17.0.0.1
8.0.0.15: WebSphere Application Server V8.0 Fix Pack 15
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
9.0.0.8: WebSphere Application Server traditional V9.0 Fix Pack 8
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
9.0.0.9: WebSphere Application Server traditional V9.0 Fix Pack 9
18.0.0.3: WebSphere Application Server Liberty 18.0.0.3
9.0.0.10: WebSphere Application Server traditional V9.0 Fix Pack 10
18.0.0.4: WebSphere Application Server Liberty 18.0.0.4
19.0.0.1: WebSphere Application Server Liberty 19.0.0.1
8.5.5.15: WebSphere Application Server V8.5.5 Fix Pack 15
19.0.0.2: WebSphere Application Server Liberty 19.0.0.2
19.0.0.3: WebSphere Application Server Liberty 19.0.0.3
9.0.0.11: WebSphere Application Server traditional V9.0 Fix Pack 11
19.0.0.4: WebSphere Application Server Liberty 19.0.0.4
19.0.0.5: WebSphere Application Server Liberty 19.0.0.5
9.0.5.0: WebSphere Application Server traditional Version 9.0.5 Refresh Pack
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
9.0.5.1: WebSphere Application Server traditional Version 9.0.5 Fix Pack 1
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
9.0.5.2: WebSphere Application Server traditional Version 9.0.5 Fix Pack 2
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
8.5.5.17: WebSphere Application Server V8.5.5 Fix Pack 17
9.0.5.3: WebSphere Application Server traditional Version 9.0.5 Fix Pack 3
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

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following JSP comment throws a
    java.lang.StringIndexOutOfBoundsException:
    
    <!DOCTYPE HTML>
    <%@page language="java" contentType="text/html;
    charset=UTF-8" pageEncoding="UTF-8"%>
    <html>
    <head>
    <title>Example</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=UTF-8">
    </head>
    <body>
    <%--%>--%>
    </body>
    </html>
    
    Exception:
    
    SRVE0777E: Exception thrown by application class
    'java.lang.StringBuffer.charAt:248'
    java.lang.StringIndexOutOfBoundsException: String index out
    of range: -1
    at java.lang.StringBuffer.charAt(StringBuffer.java:248)
    at
    com.ibm.ws.jsp.translator.document.JspPageParser.processJspC
    omment(JspPageParser.java:1177)
    ...
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server versions 8.0, 8.5 and 9.0 and        *
    *                  Liberty - JavaServer Pages (JSP)            *
    ****************************************************************
    * PROBLEM DESCRIPTION: When a JSP comment contains %> at the   *
    *                      beginning of the comment a              *
    *                      java.lang.StringIndexOutOfBoundsExcepti *
    *                      on will be thrown.                      *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    In a JSP page with a JSP comment that starts with %> a
    StringIndexOutOfBoundsException will be thrown.
    
    For example, the following JSP comment throws a
    StringIndexOutOfBoundsException:
    
    <!DOCTYPE HTML>
    <%@page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <html>
    <head>
    <title>Example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-
    8">
    </head>
    <body>
    <%--%>--%>
    </body>
    </html>
    
    Exception:
    
    SRVE0777E: Exception thrown by application class
    'java.lang.StringBuffer.charAt:248'
    java.lang.StringIndexOutOfBoundsException: String index out of
    range: -1
    at java.lang.StringBuffer.charAt(StringBuffer.java:248)
    at
    com.ibm.ws.jsp.translator.document.JspPageParser.processJspComme
    nt(JspPageParser.java:1177)
    ...
    

Problem conclusion

  • The JSP engine was modified to handle all JSP comments starting
    with %> without throwing a StringIndexOutOfBoundsException.
    
    The fix for this APAR is currently targeted for inclusion in
    WebSphere Application Server fix packs 8.0.0.14, 8.5.5.12 and
    9.0.0.4, and Liberty 17.0.0.1.  Please refer to the Recommended
    Updates page for delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

  • If a JSP comment starts with %>, precede it with an empty space.
    It should look similar to this: <%-- %>--%>.
    

Comments

APAR Information

  • APAR number

    PI73022

  • Reported component name

    LIBERTY PROFILE

  • Reported component ID

    5724J0814

  • Reported release

    CD0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-11-30

  • Closed date

    2017-01-12

  • Last modified date

    2017-01-12

  • 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

    LIBERTY PROFILE

  • Fixed component ID

    5724J0814

Applicable component levels

  • RCD0 PSY

       UP

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

Document Information

Modified date:
17 June 2020