Re: Unmarshal WebApplicationException Response JSON entity

2010-03-02 Thread DmitryM
Sergey, thanks a lot for your response. Sergey Beryozkin-5 wrote: > > I guess what you really would like to do is to write some simple > Jettison-specific code to be used inside of your exception mapper which > will > use a statically allocated JAXBContext (for your exception data bean) to > ge

Re: Unmarshal WebApplicationException Response JSON entity

2010-03-02 Thread Sergey Beryozkin
Hi JSONProvider is not really meant to be used as a utility class, the way you're using it, I suggested it for you be able to get the exception bean populated quickly. I think all the code is there at the ProviderFactory level for users be able to do JSONProvider but there could be some custom pro

Re: Unmarshal WebApplicationException Response JSON entity

2010-03-01 Thread DmitryM
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()).getClas

Re: Unmarshal WebApplicationException Response JSON entity

2010-03-01 Thread Sergey Beryozkin
Hi 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) some more comments inline cheers, Sergey On Mon, Mar 1, 2010 at 8:20 PM,

Re: Unmarshal WebApplicationException Response JSON entity

2010-03-01 Thread DmitryM
Sergey, Sergey Beryozkin-5 wrote: > > please see comments inline > Thanks for the comments. Looks like I'm getting closer. But I still have a question. Can you please comment on the parameters value for the JSONProvider.readFrom method (on those except for the apparent first and last one): p

Re: Unmarshal WebApplicationException Response JSON entity

2010-03-01 Thread Sergey Beryozkin
Hi please see comments inline cheers, Sergey On Mon, Mar 1, 2010 at 5:12 AM, DmitryM wrote: > > Sergey, thanks a lot for the response. > > I'm a little confused here. I couldn't find ResponseExceptionHandler in the > latest API doc (the link from the main CXF page). > > S.B : It's linked to fr

RE: Unmarshal WebApplicationException Response JSON entity

2010-02-28 Thread DmitryM
Sergey, thanks a lot for the response. I'm a little confused here. I couldn't find ResponseExceptionHandler in the latest API doc (the link from the main CXF page). Is there an example how to do that handler registration? Did you mean it was possible to have a generic handler for a WebApplicati

RE: Unmarshal WebApplicationException Response JSON entity

2010-02-28 Thread Sergey Beryozkin
Hi You said in the follow-up email that you were using a proxy on the client side. So you may want to register a ResponseExceptionHandler : http://cxf.apache.org/docs/jax-rs.html#JAX-RS-Handlingexceptions This handler may create an instance of JSONProvider and pass the JSON-formatted string to

Re: Unmarshal WebApplicationException Response JSON entity

2010-02-27 Thread DmitryM
A bit of clarification about what I would like to achieve. When I'm doing exception mapping I do simple Response.serverError().entity(xxx).build() and it produces perfectly formatted JSON response. On the client side I have a Java proxy which in this case gets WebApplicationException. I can get