When I had this problem it was because I was packaging an uber JAR
with a few different Jersey jars as dependencies. When they all got
blown up in my Jar they each clashed because they all had provider
definitions in the META-INF/services folder so in the end my uber Jar
didn't know what kind of provider to use for JSON. I was pointed to
this bug:
https://jersey.dev.java.net/issues/show_bug.cgi?id=440
And that solved my problem. Not sure if this is the same issue you're
having but it's the same symptoms that I had. Not sure why it would
behave differently in different environments so maybe this isn't the
same issue you're having.
Chris
On Fri, Feb 19, 2010 at 6:56 AM, Bryan Kearney <bryan.kearney_at_gmail.com> wrote:
> I have posted a similar question to the GWT list. I have a simple jersey
> client [1] which runs fine in pure java. When I deploy it to the server side
> of a GWT App running through eclipse (which also uses Jersey) then I get the
> following exception:
>
>
> Caused by: com.sun.jersey.api.client.ClientHandlerException: A message body
> reader for Java type, interface java.util.List, and MIME media type,
> application/json, was not found
> at
> com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:526)
> at
> com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:508)
> at com.sun.jersey.api.client.WebResource.handle(WebResource.java:572)
> at com.sun.jersey.api.client.WebResource.get(WebResource.java:183)
> at
> org.candlepin.client.CandlepinClient.getProducts(CandlepinClient.java:30)
> at
> org.candlepin.pinsetter.server.CandlepinServiceImpl.getProducts(CandlepinServiceImpl.java:17)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
>
> which I believe it caused by the Context not being found by the WebResource.
> Is that the correct diagnosis of this problem?
>
> [1] http://www.pastie.org/832659
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>