Hi MessageBodyWriter should be parameterized by Collection<PublisherReport>... Using Collection only will work in 2.2.3/2.2.4, Benson has done some fixes on the trunk so Collection<PublisherReport> will be the best option going forward...
That said, it is not the first time users have to deal with writing custom providers for primitive types be serialized in JSON...If no JAXB involved then may be Jackson would do well, but perhaps shipping a simple provider dealing with primitive types would help indeed... Sergey -----Original Message----- From: Gabo Manuel [mailto:[email protected]] Sent: 26 October 2009 03:46 To: [email protected] Subject: Re: No message body writer found for response class : ArrayList Hi, Just a pair of questions, is the message subject the exception message encountered? And, is the MessageBodyWriter intentionally marked as List while the method response is Collection? I think making it the other way around should set it straight. Gabo rconline wrote: > Hi Guys, > > Read all the posts on the thread. Maybe my question is stupid or maybe i > dont get the problem at all. > > Here' my web service > > @WebMethod > @GET > @Produces("application/json") > @Path("/summaryList/") > Collection<PublisherReport> getSummaryList(String test); > > I want the method should return a list of json objects. The Object > PublisherReport contains primitive/equiv object as member variables. > > Do i need to write a messagewriter as > > public class ListWriter implements MessageBodyWriter<List<PublisherReport>> > {... > } > > Or am i not getting the problem at all? > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.423 / Virus Database: 270.14.32/2459 - Release Date: 10/25/09 19:57:00 > >
