I could not find any way to instantiate a SharegroupsAPI.
Looking through the code, it appeared as if it was overlooked in SmugMugAPI .
I added it there and the project was able to compile.
However When I invoked it, I got the error below
Added this in SmugMugAPI class
public SharegroupsAPI sharegroupss(){
if (this.sharegroups == null){
this.sharegroups = new SharegroupsAPI(this);
}
return this.sharegroups;
}
This is how I call sharegroups api :
SmugMugAPI smugmug = new SmugMugAPI(APP_NAME, CONSUMER_SECRET,
CONSUMER_KEY, new Token(OAUTH_TOKEN_ID, OAUTH_TOKEN_SECRET));
SharegroupsAPI sgapi = smugmug.sharegroupss();
SEVERE: A message body reader for Java class com.github.jkschoen.jsma.response.SharegroupsResponse, and Java type class com.github.jkschoen.jsma.response.SharegroupsResponse, and MIME media type application/json; charset=utf-8 was not found
Apr 17, 2014 8:37:43 AM com.sun.jersey.api.client.ClientResponse getEntity
SEVERE: The registered message body readers compatible with the MIME media type are:
application/json; charset=utf-8 ->
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
/ ->
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.json.impl.provider.entity.JSONJAXBElementProvider$General
com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
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
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
Exception in thread "main" com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class com.github.jkschoen.jsma.response.SharegroupsResponse, and Java type class com.github.jkschoen.jsma.response.SharegroupsResponse, and MIME media type application/json; charset=utf-8 was not found
at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:561)
at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:517)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:684)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
at com.github.jkschoen.jsma.response.SMResponse.callMethod(SMResponse.java:220)
at com.github.jkschoen.jsma.SharegroupsAPI.get(SharegroupsAPI.java:201)
at Fetch.fetchAlbumNames(Fetch.java:42)
at Fetch.main(Fetch.java:53)
I could not find any way to instantiate a SharegroupsAPI. Looking through the code, it appeared as if it was overlooked in SmugMugAPI . I added it there and the project was able to compile. However When I invoked it, I got the error below
Added this in SmugMugAPI class public SharegroupsAPI sharegroupss(){ if (this.sharegroups == null){ this.sharegroups = new SharegroupsAPI(this); } return this.sharegroups; }
This is how I call sharegroups api : SmugMugAPI smugmug = new SmugMugAPI(APP_NAME, CONSUMER_SECRET, CONSUMER_KEY, new Token(OAUTH_TOKEN_ID, OAUTH_TOKEN_SECRET)); SharegroupsAPI sgapi = smugmug.sharegroupss();
SEVERE: A message body reader for Java class com.github.jkschoen.jsma.response.SharegroupsResponse, and Java type class com.github.jkschoen.jsma.response.SharegroupsResponse, and MIME media type application/json; charset=utf-8 was not found Apr 17, 2014 8:37:43 AM com.sun.jersey.api.client.ClientResponse getEntity SEVERE: The registered message body readers compatible with the MIME media type are: application/json; charset=utf-8 -> com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App / -> 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.json.impl.provider.entity.JSONJAXBElementProvider$General com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General 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 com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
Exception in thread "main" com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class com.github.jkschoen.jsma.response.SharegroupsResponse, and Java type class com.github.jkschoen.jsma.response.SharegroupsResponse, and MIME media type application/json; charset=utf-8 was not found at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:561) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:517) at com.sun.jersey.api.client.WebResource.handle(WebResource.java:684) at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507) at com.github.jkschoen.jsma.response.SMResponse.callMethod(SMResponse.java:220) at com.github.jkschoen.jsma.SharegroupsAPI.get(SharegroupsAPI.java:201) at Fetch.fetchAlbumNames(Fetch.java:42) at Fetch.main(Fetch.java:53)