IBM Support

PI50692: Data conversion issue for Multi-part MIME on mainframe (z/OS)

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • We have a method annotated as follows:-
    
    @POST
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    @Produces(MediaType.TEXT_XML)
    
    When we look through the parts on zOS, using:
    while (iterator.hasNext())
    { InPart part = iterator.next(); InputStream is =
    part.getBody(InputStream.class, null); ... }
    
    we see an exception
    java.lang.StringIndexOutOfBoundsException
    at java.lang.String.substring(String.java:1092)
    at
    org.apache.wink.common.internal.providers.multipart.MultiPar
    tParser.parseHeaders(MultiPartParser.java:264)
    at
    org.apache.wink.common.internal.providers.multipart.MultiPar
    tParser.nextPart(MultiPartParser.java:109)
    at
    org.apache.wink.common.model.multipart.InMultiPart.hasNext(I
    nMultiPart.java:83)
    ...
    
    The headers going over the wire are in UTF-8, but it seems
    that Wink is trying to decode them as platform encoding (for
    example, a new String(bytes), without a codepage specified).
    On a Windows/Linux operating system this would work for
    normal codepoints, but on z/OS, EBCDIC encoding is nothing
    like UTF-8, so the assumption wouldn't work.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty Profile - JAX-RS 1.1 on      *
    *                  z/OS                                        *
    ****************************************************************
    * PROBLEM DESCRIPTION: Apache Wink data conversion issue for   *
    *                      Multi-part MIME on z/OS                 *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    This problem only occurrs on z/OS operating systems.  Apache
    Wink is trying to decode a HTTP header whose encoding is UTF-8
    from byte[] to String via new String (byte [] data, int start,
    int length), not taking any encoding into account. The platform
    encoding will be used. On z/OS, the platform encoding is EBCDIC,
    this causes a java.lang.StringIndexOutOfBoundsException to be
    thrown.
    java.lang.StringIndexOutOfBoundsException
    at java.lang.String.substring(String.java:1092)
    at
    org.apache.wink.common.internal.providers.multipart.MultiPartPar
    ser.parseHeaders(MultiPartParser.java:264)
    at
    org.apache.wink.common.internal.providers.multipart.MultiPartPar
    ser.nextPart(MultiPartParser.java:109)
    at
    org.apache.wink.common.model.multipart.InMultiPart.hasNext(InMul
    tiPart.java:83)
    ...
    

Problem conclusion

  • We now use new String (byte [] data, int start, int length,
    final String encoding) instead of new String (byte [] data, int
    start, int length) when decoding the HTTP header.
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack8.5.5.9.  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

    PI50692

  • 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

    2015-10-16

  • Closed date

    2016-02-23

  • Last modified date

    2016-02-23

  • 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