You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Anton Piatek (JIRA)" <ji...@apache.org> on 2012/12/05 13:06:58 UTC

[jira] [Commented] (WINK-371) Data conversion issue for Multi-part MIME on mainframe (z/OS)

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

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

unfortunately I still get the same error:
java.lang.StringIndexOutOfBoundsException</cause><stackTrace>java.lang.String.substring(String.java:1092)
org.apache.wink.common.internal.providers.multipart.MultiPartParser.parseHeaders(MultiPartParser.java:264)
org.apache.wink.common.internal.providers.multipart.MultiPartParser.nextPart(MultiPartParser.java:109)
org.apache.wink.common.model.multipart.InMultiPart.hasNext(InMultiPart.java:83)

I think your stdouts were captured in our debug trace, however I don't think they are going to help much as they seem to be coming out in the wrong codepage:
2012-12-05 11:52:35.353092       43 org.apache.wink.server.internal.log.LogUtilities.logResourceMetadata 'MbJavaUtilLogHandler:FINEST' , 'Resource information for com.ibm.broker.
admin.requestHandlers.UploadedResourceHandler:
Path                                                                             HTTP Method   Consumes             Produces		 Resource Method
workspace/uploadedResource                                                       GET           [*/*]                [application/json]   com.ibm.broker.admin.requestHandlers.Uplo
adedResourceHandler.getResources(Request)
workspace/uploadedResource/{browserType}/upload/{mainResource}/commit 		 POST	       [*/*]                [application/json]   com.ibm.broker.admin.requestHandlers.Uplo
adedResourceHandler.commitUploadedResource(Request,String,String)
workspace/uploadedResource/uploadedWSDLs/{resourceName}                          DELETE        [*/*]                [application/json]   com.ibm.broker.admin.requestHandlers.Uplo
adedResourceHandler.deleteWSDL(String,Request)
workspace/uploadedResource/{browserType}/upload/{mainResource}                   POST          [multipart/form-data] [text/html]          com.ibm.broker.admin.requestHandlers.Upl
oadedResourceHandler.uploadDependentResource(Request,InMultiPart,String,String)
workspace/uploadedResource/uploadedWSDLs/{resourceName}                          DELETE	       [*/*]                [application/json]   com.ibm.broker.admin.requestHandlers.Uplo
adedResourceHandler.deleteWSDL(String,Request)
workspace/uploadedResource/{browserType}/upload/{mainResource}                   POST	       [multipart/form-data] [text/html]          com.ibm.broker.admin.requestHandlers.Upl
oadedResourceHandler.uploadDependentResource(Request,InMultiPart,String,String)
workspace/uploadedResource/{browserType}/upload                                  POST	       [multipart/form-data] [text/html]          com.ibm.broker.admin.requestHandlers.Upl
oadedResourceHandler.uploadResource(Request,InMultiPart,String)
workspace/uploadedResource/{type}                                                GET           [*/*]                [application/json]   com.ibm.broker.admin.requestHandlers.Uplo
adedResourceHandler.getResourcesForType(String,Request)'
2012-12-05 11:52:35.356592       43 org.apache.wink.server.internal.log.ResourceInvocation.logFinishRequest 'MbJavaUtilLogHandler:FINE' , 'Resource invocation:
-> com.ibm.broker.admin.requestHandlers.UploadedResourceHandler.uploadResource(Request,InMultiPart,String)'
2012-12-05 11:52:35.358252	 43 org.apache.wink.server.internal.log.Requests.logFinishRequest 'MbJavaUtilLogHandler:FINEST' , 'logFinishRequest() entry'
2012-12-05 11:52:35.359728       43 org.apache.wink.server.internal.log.Requests.logFinishRequest 'MbJavaUtilLogHandler:FINE' , 'The request entity as a String in the default enc
oding:'
2012-12-05 11:52:35.361288       43 org.apache.wink.server.internal.log.Requests.logFinishRequest 'MbJavaUtilLogHandler:FINE' , '^A000000000000000000000000^B^57^65^62.^69^74^46?^
72_^42?^75>^64/^72`^71^39|^63^34^64^48^42(^51%^39^52^58^33^43
^0A^43?>^74^65>^74^A0000^B^44^69^73^70?^73^69^74^69?>^3A^20^66?^72_^A0000^B^64/^74/^3B^20>/_^65^A0000^B^22^75^70%?/^64^65^64^66^69%^65^73$)^22^3B^20^66^69%^65>/_^65^A0000^B^22^77
^0A^43?>^74^65>^74^A0000^B^54`^70^65^3A^20/^70^70%^69^63/^74^69?>^A0000^B?^63^74^65^74^A0000^B^73^74^72^65/_
......

                
> 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: MultiPartParser.class, 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