IBM Support

PI40418: WebContainer throws a java.lang.IllegalArgument exception when p arsing parameters

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • If an inbound request includes a Content-Type header which
    specifies an invalid charset, the webcontainer will try to
    use the charset when parsing parameters and an
    IllegalArgumentException is thrown.
    
    Stack Dump = java.lang.IllegalArgumentException
     at
    com.ibm.wsspi.webcontainer.util.RequestUtils.parseQueryStrin
    g(RequestUtils.java:408)
     at
    com.ibm.wsspi.webcontainer.util.RequestUtils.parseQueryStrin
    g(RequestUtils.java:106)
     at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.parseQueryStri
    ngList(SRTServletRequest.java:2432)
     at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.parseParameter
    s(SRTServletRequest.java:2396)
     at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameter(S
    RTServletRequest.java:1853)
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty Profile - Web Container      *
    ****************************************************************
    * PROBLEM DESCRIPTION: WebContainer throws a                   *
    *                      java.lang.IllegalArgument exception     *
    *                      when parsing parameters.                *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    If an inbound request includes a Content-Type header which
    specifies an invalid charset, the WebContainer will try to use
    the charset when parsing parameters and an
    IllegalArgumentException is thrown. For example:
    
    java.io.UnsupportedEncodingException: SRVE0254E: Failed to set
    request character encoding: [invalid-charset].
        at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.setCharacterEncodi
    ng(SRTServletRequest.java:484)
        at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.getCharacterEncodi
    ng(SRTServletRequest.java:1507)
        at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.getReaderEncoding(
    SRTServletRequest.java:1575)
        at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.parseQueryStringLi
    st(SRTServletRequest.java:2432)
        at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.parseParameters(SR
    TServletRequest.java:2396)
        at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameter(SRTSe
    rvletRequest.java:1853)
    
    
    Stack Dump = java.lang.IllegalArgumentException
     at
    com.ibm.wsspi.webcontainer.util.RequestUtils.parseQueryString(Re
    questUtils.java:408)
     at
    com.ibm.wsspi.webcontainer.util.RequestUtils.parseQueryString(Re
    questUtils.java:106)
     at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.parseQueryStringLi
    st(SRTServletRequest.java:2432)
     at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.parseParameters(SR
    TServletRequest.java:2396)
     at
    com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameter(SRTSe
    rvletRequest.java:1853)
    

Problem conclusion

  • The WebContainer has been modified to ignore an invalid charset
    value in the Content-Type header when parsing parameters and
    will instead use the value it would have used had the Content-
    Type header not been included in the request.
    
    However, note that the behavior of
    ServletRequest.getCharacterEncoding() is unchanged and this api
    will return the value of the charset from the Content-Type
    header even if it is invalid.
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack 8.5.5.6.  Please refer to the Recommended Updates page for
    delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

  • Modiy the client to set the Content-Type header to a valid
    charset.
    

Comments

APAR Information

  • APAR number

    PI40418

  • Reported component name

    LIBERTY PROFILE

  • Reported component ID

    5724J0814

  • Reported release

    850

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2015-05-05

  • Closed date

    2015-06-02

  • Last modified date

    2015-06-02

  • 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

  • R850 PSY

       UP

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

Document Information

Modified date:
28 April 2022