users@jersey.java.net

[Jersey] MediaDelegate returning null pointer exception when deployed in OSGI

From: ShivikaSharma <shivisaggi_at_gmail.com>
Date: Sun, 19 Jul 2015 21:27:22 -0700 (MST)

I have a code which sends the request to remote server to get the response.
Though the response is being returned but returns NPE on below line:

 return (String) response.getEntity(String.class);
response.getEntity returns NullPointerException once deployed this code on
OSGI container. It works as a standalone Java Application

Following dependencies are part of the bundle: com.sun.jersey jersey-client
1.18 com.sun.jersey jersey-json 1.18 com.sun.jersey.contribs
jersey-multipart 1.18

The exception returned is java.lang.NullPointerException: null at
javax.ws.rs.core.MediaType.valueOf(MediaType.java:119) at
com.sun.jersey.api.client.ClientResponse.getType(ClientResponse.java:695) at
com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:612)
at
com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:586)
at io.swagger.client.ApiInvoker.invokeAPI(ApiInvoker.java:179)

Please help me resolve the issue as it is really urgent.



--
View this message in context: http://jersey.576304.n2.nabble.com/MediaDelegate-returning-null-pointer-exception-when-deployed-in-OSGI-tp7583398.html
Sent from the Jersey mailing list archive at Nabble.com.