Uploaded image for project: 'Wink'
  1. Wink
  2. WINK-371

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2
    • None
    • Server
    • None
    • z/OS primarily

    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.MultiPartParser.parseHeaders(MultiPartParser.java:264)
      at org.apache.wink.common.internal.providers.multipart.MultiPartParser.nextPart(MultiPartParser.java:109)
      at org.apache.wink.common.model.multipart.InMultiPart.hasNext(InMultiPart.java:83)
      ...

      The headers going over the wire are in UTF-8, but I believe Wink is trying to decode them as platform encoding (e.g. a new String(bytes), without a codepage specified). On a regular windows/linux box this would work for normal codepoints, but on zOS, EBCDIC encoding is nothing like UTF-8, so the assumption wouldn't work. I'm unfortunately not permitted to look at wink sourcecode (legal reasons) so I cannot verify this myself, but as this is a string handling error on a UTF-8 string, that is the best guess I can do.

      Attachments

        1. wink-common-1.3.0-incubating-SNAPSHOT-with-wink371-fix.jar
          575 kB
          Luciano Resende
        2. MultiPartParser.class
          7 kB
          Luciano Resende

        Activity

          People

            Unassigned Unassigned
            pmasters Peter Masters
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: