users@glassfish.java.net

Re: glassfish 3.1 with jersey 1.5 (out of the box) client issues

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Fri, 22 Apr 2011 09:53:37 +0200

Hello,

can you please share your client code/reproducible testcase? Btw
jersey-json needs to be on your classpath as other dependencies (looks
like you are using jettison).

Or you can take a look at our samples which are using JSON:

http://download.java.net/maven/2/com/sun/jersey/samples/jacksonjsonprovider/1.5/jacksonjsonprovider-1.5-project.zip
http://download.java.net/maven/2/com/sun/jersey/samples/json-from-jaxb/1.5/json-from-jaxb-1.5-project.zip

Thanks,
Pavel

On 4/21/11 7:49 PM, forums_at_java.net wrote:
> Also, I've noticed that with respect to clients; if I add the
> jersey-json jar
> file the exception seems to change (for the worse? or the better? I can't
> tell).
>
> SEVERE: A Message body reader for Java class java.lang.String, and
> Java Type
> class java.lang.String, and MIME media tyep text/plain was not found ...
> ocm.sun.jersey.api.client.ClientResponse getEntity SEVERE: The registered
> message body readers compatible with the MIME media types are: */* ->
> com.sun.jersey.impl.provider.entity.JSONJAXBElementProvider$General
> com.sun.jersey.impl.provider.entity.JSONArrayProviderr$General
> com.sun.jersey.impl.provider.entity.JSONObjectProvider$General
> com.sun.jersey.impl.provider.entity.JSONRootElementProvider$General
> com.sun.jersey.impl.provider.entity.JSONListElementProvider$General
> Caused
> by: com.sun.jersey.api.client.ClientHandlerException: A message body
> reader
> for Java class java.lang.String, and Java type class java.lang.String,
> and
> MIME media type text/plain was not found Thanks again.
>
> --
>
> [Message sent by forum member 'hoffman462']
>
> View Post: http://forums.java.net/node/794091
>
>
>