We're updating the issue view to help you get more done.Learn more

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

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:
Loading project config from zanata.xml
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

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

Status

Assignee

Patrick Huang

Reporter

Ding-Yi Chen

Components

Sprint

None

Fix versions

Affects versions

client-3.8.1

Priority

Medium