title: Does rest supports arraylist of objects?
body: <p>I am having a class BookMain which is returning an arraylist of objects. I am using REST service to get the output, but I am getting an error.</p>
  
  <p><em>This is my BookMain class:</em></p>
  
  <pre><code>@GET
  @Path("/get")
  @Produces(MediaType.APPLICATION_XML)
  public ArrayList&lt;Object&gt; addObjects() {
  
      Book book = new Book(); 
      book.setName("The Book");
      book.setAuthor("Author");
  
      BookStore bookstore = new BookStore();
      bookstore.setName("The Bookstore");
      bookstore.setLocation("UK");
  
      ArrayList&lt;Object&gt; list = new ArrayList&lt;Object&gt;();
      list.add(book);
      list.add(bookstore);
  
      return list;   
  }
  </code></pre>
  
  <p><em>This is the error which I am getting:</em></p>
  
  <pre><code>11 Jul, 2013 3:36:52 PM com.sun.jersey.spi.container.ContainerResponse write
  SEVERE: A message body writer for Java class java.util.ArrayList, and Java type java.util.ArrayList&lt;java.lang.Object&gt;, and MIME media type application/xml was not found 11 Jul, 2013 3:36:52 PM com.sun.jersey.spi.container.
  ContainerResponse write SEVERE: The registered message body writers 
  compatible with the MIME media type are:application/xml -&gt;
  com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App
  com.sun.jersey.core.impl.provider.entity.DocumentProvider
  com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
  com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
  com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App
  </code></pre>
  
  <p>Can anyone provide me a solution for it ?</p>