You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Florian Müller (JIRA)" <ji...@apache.org> on 2014/03/26 08:53:15 UTC

[jira] [Assigned] (CMIS-771) deleteTree via compressed (gzipped) JSON fails with: Unexpected token END OF FILE at position 0.

     [ https://issues.apache.org/jira/browse/CMIS-771?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florian Müller reassigned CMIS-771:
-----------------------------------

    Assignee: Florian Müller

> deleteTree via compressed (gzipped) JSON fails with: Unexpected token END OF FILE at position 0.
> ------------------------------------------------------------------------------------------------
>
>                 Key: CMIS-771
>                 URL: https://issues.apache.org/jira/browse/CMIS-771
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-client
>    Affects Versions: OpenCMIS 0.10.0
>         Environment: (Apache) Web server configured to compress (gzip) responses for (Android) clients
>            Reporter: Achim Derigs
>            Assignee: Florian Müller
>            Priority: Minor
>              Labels: patch
>             Fix For: OpenCMIS 1.0.0, OpenCMIS 0.11.0
>
>         Attachments: patch
>
>
> Since HTTP's Content-Length header returns the compressed size, it is an error to use getContentLength() to size buffers for the uncompressed data. Instead, read bytes from the response until InputStream.read() returns -1. See: http://android-developers.blogspot.de/2011/09/androids-http-clients.html
> If the Web Server decides to compress the response of the deleteTree request you will get a Content-Length of 20 for a compressed (gzipped) empty body. This makes no sense but is valid. ;-)
> org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Parsing exception!
>         at org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.parse(AbstractBrowserBindingService.java:325)
>         at org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.parseObject(AbstractBrowserBindingService.java:289)
>         at org.apache.chemistry.opencmis.client.bindings.spi.browser.ObjectServiceImpl.deleteTree(ObjectServiceImpl.java:506)
>         at org.alfresco.mobile.android.api.services.impl.AbstractDocumentFolderServiceImpl.delete(AbstractDocumentFolderServiceImpl.java:684)
>         at org.alfresco.mobile.android.api.services.impl.AbstractDocumentFolderServiceImpl.deleteNode(AbstractDocumentFolderServiceImpl.java:646)
>         ... 2 more
> Caused by: Unexpected token END OF FILE at position 0.
>         at org.apache.chemistry.opencmis.commons.impl.json.parser.JSONParser.parse(JSONParser.java:273)
>         at org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.parse(AbstractBrowserBindingService.java:323)
>         ... 6 more



--
This message was sent by Atlassian JIRA
(v6.2#6252)