It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

A message body reader not found for api.model.content.Space and MIME media type text/html Edited

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

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

8,367 views 6 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you