Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61471

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • confluent-publisher 2.0.5
      jenkins ver. 2.204.5
      confluence 6.15.8

      Publishing fails after upgrading from 2.0.3 to 2.0.5 with com.sun.jersey.api.client.ClientHandlerException. 

      agent {
          archiveArtifacts artifacts: file.txt
          publishConfluence pageName: 'My page', spaceName: 'SpaceA', attachArchivedArtifacts: true
      }

       

      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)
      

      It seems to fail when fetching the space, the response status is < 300 so the plugin tries to deserialize the response body into Space entity but content is html which is probably an error.

      remoteSpaceService.find()
              .withKeys(spaceKey).fetchOne().claim()
      

      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
      

            jhansche Joe Hansche
            ansc Ana S
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: