Sergey,

Looks like parametrizing JSONProvider could be a good idea, but I managed to
get away with the following code:

MyExceptionWrapper unmarshalledObject =
(MyExceptionWrapper)jsonProvider.readFrom(
                                            (Class)((Object)new 
MyExceptionWrapper()).getClass(), 
                                            null, null, 
MediaType.APPLICATION_JSON_TYPE, null, 
                                                (InputStream)new
ByteArrayInputStream(response.getEntity().toString().getBytes()));
                                exceptionWrapper = 
(MyExceptionWrapper)unmarshalledObject;
                                exClass = (Class<PimsCheckedException>)
Class.forName(exceptionWrapper.exceptionClassName);

It does look a little ugly (especially because I had to cast my class to
Object since JSONProvider implements ), but it works.
Please, if you have a few minutes, let me know if it could have been done in
a simpler way (I could not figure out how to get a specific writer for a
specific class)

Thanks,
Dmitry


Sergey Beryozkin-5 wrote:
> 
> Please see
> 
> https://jsr311.dev.java.net/nonav/releases/1.0/javax/ws/rs/ext/MessageBodyReader.html#isReadable(java.lang.Class,%20java.lang.reflect.Type,%20java.lang.annotation.Annotation[],%20javax.ws.rs.core.MediaType)
> 

-- 
View this message in context: 
http://old.nabble.com/Unmarshal-WebApplicationException-Response-JSON-entity-tp27726278p27749802.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to