Hi, thanks for the help. Actually everything was working fine except a small miss-interpretation of the arguments in method isWritable. This led to the return value false indeed. Now it´s working. Thanks a lot. Regards, Stefan
-------- Original-Nachricht -------- > Datum: Sat, 21 May 2011 16:32:14 +0100 > Von: Sergey Beryozkin <[email protected]> > An: [email protected] > Betreff: Re: Custom MessageBodyWriter > Hi > > On Sat, May 21, 2011 at 12:07 PM, Stefan Henke <[email protected]> wrote: > > Hi, > > I´m currently trying to register a custom MessageBodyWriter for my > jax-rs service in order to serialize a very specific object my service is > returning. Unfortunately, I´m getting a "No message body has been found..." > error when calling the service. > > I´m doing the following: > > 1) Providing a class implementing javax.ws.rs.ext.MessageBodyWriter > which is also annotated with @Provider. > > 2) Additionally, I added the following init parameter to the > CXFNonSpringJaxrsServlet in web.xml: > > <init-param> > > <param-name>jaxrs.providers</param-name> > > <param-value>com.d.MyMessageBodyWriter</param-value> > > </init-param> > > > > Is there anything I´m missing or is there a completely different way of > achieving what I need? > > Waiting for your help ;-) > > When CXF JAX-RS selects a writer, it checks if @Consumes annotation > which should be available on the resource method matches that of a > current writer. If the match is successful then it checks > writer.isWriteable. > Please check: > - the provider has a correct @Consumes value > - enable FINE/TRACE logging and verify the selected method' Consumes > matches the provider's one > - make sure isWriteable returns true > > HTH > > Cheers, Sergey > > > > Best regards, > > Stefan > > -- > > Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir > > belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de > > > > > > -- > Sergey Beryozkin > > Application Integration Division of Talend > http://sberyozkin.blogspot.com -- NEU: FreePhone - kostenlos mobil telefonieren! Jetzt informieren: http://www.gmx.net/de/go/freephone
