GET space fails with during response deserialization. It seems response code is < 300 and jersey tries to get entity as com.atlassian.confluence.api.model.content.Space but Content-type is text/xml.
com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class com.atlassian.confluence.api.model.content.Space, and Java type class com.atlassian.confluence.api.model.content.Space, 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:586) at com.sun.jersey.api.client.WebResource.handle(WebResource.java:686) at com.sun.jersey.api.client.WebResource.get(WebResource.java:193) at com.atlassian.confluence.rest.client.AbstractRemoteService.getOption(AbstractRemoteService.java:181) at com.atlassian.confluence.rest.client.AbstractRemoteService.lambda$getFutureOption$1(AbstractRemoteService.java:77) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
Client call:
remoteSpaceService.find()
.withKeys(spaceKey).fetchOne().claim()
This code is from confluence-publisher jenkins plugin, and I'm trying to figure where the problem really lies, and in what cases the api could respond with http code 2xx but text/html content?
When i try the following curl i get a valid json response, using the same basic auth user used by the plugin:
curl -i -X GET -H "Authorization: Basic *********" https://myconfluence.com/rest/api/space?spaceKey=SpaceA
HTTP/2 200