1

I tried the tutorial code to create and get JIRA issues here and solved all the dependencies.
But I am getting the Exception in the line

//GET Issue
 final Issue issue = restClient.getIssueClient().getIssue("RAD-1458", pm);

as follows

May 28, 2015 7:05:46 PM com.sun.jersey.api.client.ClientResponse getEntity
SEVERE: A message body reader for Java class org.codehaus.jettison.json.JSONObject, and Java type class org.codehaus.jettison.json.JSONObject, and MIME media type application/json; charset=UTF-8 was not found
May 28, 2015 7:05:46 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

Exception in thread "main" com.atlassian.jira.rest.client.RestClientException: com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class org.codehaus.jettison.json.JSONObject, and Java type class org.codehaus.jettison.json.JSONObject, and MIME media type application/json; charset=UTF-8 was not found
    at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:75)
    at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.getAndParse(AbstractJerseyRestClient.java:80)
    at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.getIssue(JerseyIssueRestClient.java:108)
    at JiraClient.main(JiraClient.java:32)
Caused by: com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class org.codehaus.jettison.json.JSONObject, and Java type class org.codehaus.jettison.json.JSONObject, and MIME media type application/json; charset=UTF-8 was not found
    at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:549)
    at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:506)
    at com.sun.jersey.api.client.WebResource.handle(WebResource.java:674)
    at com.sun.jersey.api.client.WebResource.get(WebResource.java:191)
    at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$1.call(AbstractJerseyRestClient.java:84)
    at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:54)
    ... 3 more

I am trying the Jira client as the java project in eclipse[Just created as New Java Project in Eclipse]. I am not aware of the maven and all. Am I missing any other jar dependency? Or anything should I add to my java project.

Sajeev
  • 783
  • 3
  • 14
  • 46
  • Seems to me like a similar question was answered here: http://stackoverflow.com/a/7781079/865499 – maricn May 28 '15 at 14:21
  • The answer link no more exists: "The page you were looking for doesn't exist." – Sajeev May 30 '15 at 09:50
  • Did you ever find out the problem? I am running into the exact same error now. – Whitecat Dec 13 '16 at 00:24
  • I remember, it was the version issue. We are using many jar files(dependencies) associated to do this. So all the versions should be compact-able as listed in this page. https://ecosystem.atlassian.net/wiki/display/JRJC/Project+Dependencies – Sajeev Dec 14 '16 at 15:17

0 Answers0