6 Replies Latest reply on Nov 10, 2010 10:08 AM by sverker.sverker.abrahamsson.com

    NoMessageBodyWriterFoundFailure with resteasy

    sverker.sverker.abrahamsson.com
      I'm trying to do a resteasy service but I keep getting this error:

      Failed executing GET /log/search
      org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: java.util.ArrayList of media type: application/xml

      I've found several forum posts on similar problems but no answers that gives a clue on how to solve it. My service class is a stateless ejb and seam component, so I've put the resteasy annotations on the interface, the method is annotated with @Produces({MediaType.APPLICATION_XML}).

      I've tried various variants, like returning the List directly and via a Response object like this:

      return Response.ok(PushLog.findByMsisdn(em, msisdn, startDate, endDate)).build();

      Both give the same error.

      The ejb is in a jar which is packed together with the war to an ear. All the libs are in the ear with classpath reference from war manifest.

      Any suggestions? Feels like I would be missing some jar but this is the resteasy related jar's I have:

      jboss-seam-resteasy-2.2.0.GA.jar
      resteasy-atom-provider-1.2.1.GA.jar
      resteasy-jaxb-provider-1.2.1.GA.jar
      resteasy-jaxrs-1.2.1.GA.jar