Uploaded image for project: 'Zanata'
  1. ZNTA-937

zanata-client: need better error message for unexpected html response

    Details

    • Type: Bug
    • Status: Merged (View workflow)
    • Priority: Medium
    • Resolution: Ready for Release
    • Affects Version/s: client-3.8.1
    • Fix Version/s: client-3.8.2
    • Component/s: Client Java
    • Labels:
      None
    • Sprint:
      16.04, 16.05, 16.14

      Description

      Soon, https;//translate.zanata.org/zanata/ will be shorten as
      https://translate.zanata.org/ by using HTTP 301 (Moved Permanently).

      However zanata-client failed to handled this:

      Steps to repoduced:
      1. Get zanata.xml from https://translate.stage.zanata.org/iteration/view/selinux-coloring-book/selinux-coloring-book
      2. Change url to " https://translate.stage.zanata.org/zanata/" in
      both zanata.xml and ~/.config/zanata.ini
      3. zanata-cli -B -e pull

      Actual:
      [INFO] Loading project config from zanata.xml
      [INFO] Loading user config from /home/dchen/.config/zanata.ini
      Feb 25, 2016 4:17:21 PM com.sun.jersey.api.client.ClientResponse getEntity
      SEVERE: A message body reader for Java class java.util.List, and Java type java.util.List<org.zanata.rest.dto.LocaleDetails>, and MIME media type text/html; charset=UTF-8 was not found
      Feb 25, 2016 4:17:21 PM com.sun.jersey.api.client.ClientResponse getEntity
      SEVERE: The registered message body readers compatible with the MIME media type are:
      / ->
      com.sun.jersey.core.impl.provider.entity.FormProvider
      com.sun.jersey.core.impl.provider.entity.StringProvider
      com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
      com.sun.jersey.core.impl.provider.entity.FileProvider
      com.sun.jersey.core.impl.provider.entity.InputStreamProvider
      com.sun.jersey.core.impl.provider.entity.DataSourceProvider
      com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
      com.sun.jersey.core.impl.provider.entity.ReaderProvider
      com.sun.jersey.core.impl.provider.entity.DocumentProvider
      com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
      com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
      com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
      com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
      com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
      com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
      com.sun.jersey.core.impl.provider.entity.EntityHolderReader

      [ERROR] Execution failed:
      com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class java.util.List, and Java type java.util.List<org.zanata.rest.dto.LocaleDetails>, and MIME media type text/html; charset=UTF-8 was not found
      at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:630)
      at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:604)
      at com.sun.jersey.api.client.WebResource.handle(WebResource.java:698)
      at com.sun.jersey.api.client.WebResource.get(WebResource.java:198)
      at org.zanata.rest.client.ProjectIterationLocalesClient.getLocales(ProjectIterationLocalesClient.java:54)
      at org.zanata.client.commands.OptionsUtil.fetchLocalesFromServer(OptionsUtil.java:113)
      at org.zanata.client.commands.OptionsUtil.applyConfigFiles(OptionsUtil.java:100)
      at org.zanata.client.commands.ArgsUtil.runCommand(ArgsUtil.java:41)
      at org.zanata.client.ZanataClient.processArgs(ZanataClient.java:170)
      at org.zanata.client.ZanataClient.main(ZanataClient.java:95)

      Expected:
      Pull without problem

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                pahuang Patrick Huang
                Reporter:
                dchen Ding-Yi Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: