users@jersey.java.net

[Jersey] ERROR on .getEntity(String.class);

From: <sebastien.porta_at_s-porta.fr>
Date: Wed, 25 Jan 2012 22:17:46 +0000 (GMT)

Hi there,

I have a problem on Android with jersey-client...
I'm using jersey-core-1.11 and jersey-client-1.11
I'm trying to execute this code :

WebResource webResource = Client.create().resource(nodeEntryPointUri);
ClientResponse response = webResource.path("signalised")
                                       
.queryParam("representationJSON", object.toString())
                                        .accept("application/json")
                                        .get( ClientResponse.class );
Log.d(TAG,"object " + response);
String output = response.getEntity(String.class);

But on the last line i have this error :
01-25 21:52:46.273: E/AndroidRuntime(233): Uncaught handler: thread
main exiting due to uncaught exception
01-25 21:52:46.282: E/AndroidRuntime(233):
java.lang.NullPointerException
01-25 21:52:46.282: E/AndroidRuntime(233): at
javax.ws.rs.core.MediaType.valueOf(MediaType.java:119)
01-25 21:52:46.282: E/AndroidRuntime(233): at
com.sun.jersey.api.client.ClientResponse.getType(ClientResponse.java:61
5)
01-25 21:52:46.282: E/AndroidRuntime(233): at
com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:
532)

Is there a solution ? can someone help me ?
Thx in advance.