0 Replies Latest reply on Jun 8, 2018 9:52 AM by Jakob Kelvin

    send ArrayList over JAX-RS API

    Jakob Kelvin Newbie

      Hey!

       

      I want to send a List<SomeObject> over a JAX-RS API.

       

      SomeObject is Serializable and annotated with @XmlRootElement. Also there is a (registered) MessageBodyWriter for this Object.

      The response looks like this: return Response.ok(result, MediaType.APPLICATION_XML).build(); where result is a List<SomeObject>.

      The API Function is annotated with @GET and @Produces(MediaType.APPLICATION_XML).

       

      Dependencies are:

      javax : javaee-api : 7.0

      org.jboss.resteasy : resteasy-jaxrs : 3.1.3.Final

      org.jboss.resteasy : resteasy-jaxb-provider : 3.5.1.Final

       

      Wildfly version is 10.1.0.Final

       

      When I call that API, I always get the following error message in the Wildfly log:

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