[ 
https://issues.apache.org/jira/browse/WINK-371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498753#comment-13498753
 ] 

Anton Piatek commented on WINK-371:
-----------------------------------

Hi, I work with Pete and have been trying to veryfiy your fix.

Initially I unpacked your supplied jar and updated my wink 1.2 jar with the 
classes you provided. This unfortunately broke the json marshaller, presumably 
due to a change between 1.2 and 1.3.

Then I tried to update just a few class files to see if that would fix it. 
I took my clean wink 1.2 jar and updated it with the following class files from 
your supplied jar:
./org/apache/wink/common/internal/providers/multipart/MultiPartParser$PartInputStream.class
./org/apache/wink/common/internal/providers/multipart/MultiPartParser.class
my 
This did no break the json marshaller, but it appears not to have fixed the 
issue - the following error is still seen:
java.lang.StringIndexOutOfBoundsException</cause><stackTrace>java.lang.String.substring(String.java:1092)
org.apache.wink.common.internal.providers.multipart.MultiPartParser.parseHeaders(MultiPartParser.java:265)
org.apache.wink.common.internal.providers.multipart.MultiPartParser.nextPart(MultiPartParser.java:110)
org.apache.wink.common.model.multipart.InMultiPart.hasNext(InMultiPart.java:83)

It is unfortunate that our legal department has prohibited us from looking at 
the wink source code.
                
> Data conversion issue for Multi-part MIME on mainframe (z/OS)
> -------------------------------------------------------------
>
>                 Key: WINK-371
>                 URL: https://issues.apache.org/jira/browse/WINK-371
>             Project: Wink
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.2
>         Environment: z/OS primarily
>            Reporter: Peter Masters
>         Attachments: 
> wink-common-1.3.0-incubating-SNAPSHOT-with-wink371-fix.jar
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to