title: Could not find writer for content-type application/xml type: java.util.ArrayList
body: <p>I'm writing a RESTEasy client to connect with a RESTful service. The RESTful service looks as follows:</p>
  
  <pre><code>@Path("locations")
  public class LocationService {
  
      @POST
      @Path("/myObjects")
      @Produces({MediaType.APPLICATION_XML})
      @Consumes({MediaType.APPLICATION_XML})
      public List&lt;MyObjects&gt; CreateObjects( List&lt;MyObjects&gt; objList ) {
      ...
      }
  }
  </code></pre>
  
  <p>The MyObjects class include the proper XML annotations:</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "my-objects")
  public class MyObjects {
      ...
  }
  </code></pre>
  
  <p>In my client, I have a list of MyObjects that I'm attempting to post to the service, like so:</p>
  
  <pre><code>import javax.ws.rs.client.Client;
  import javax.ws.rs.client.ClientBuilder;
  import javax.ws.rs.client.Entity;
  import javax.ws.rs.client.Invocation;
  import javax.ws.rs.client.WebTarget;
  import javax.ws.rs.core.Response;
  import javax.ws.rs.core.Response.Status;
  
  
  public static voice main(String[] args){
  
      List&lt;MyObjects&gt; objectList = new ArrayList&lt;&gt;();
      objectList.add(...)
  
      ... 
  
      Client client = ClientBuilder.newClient();
      WebTarget target = client.target(RESTFUL_URL).path("locations/myObjects");
      Invocation.Builder builder = target.request(MediaType.APPLICATION_XML_TYPE);
      Entity&lt; List&lt;MyObjects&gt; &gt;  request = Entity.entity( objectList , MediaType.APPLICATION_XML_TYPE );
  
      Response resp = builder.post(request);
  
      if( Status.Family.Success == resp.getStatusInfo().getFamily() ) {
          ...
      }
  }
  </code></pre>
  
  <p>When the <code>builder.post(request)</code> line executes, I get the following exception:</p>
  
  <pre><code> javax.ws.rs.ProcessingException: could not find writer for content-type application/xml type: java.util.ArrayList
      at org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40)
      at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:138)
      at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:117)
      at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:100)
      at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:122)
      at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:341)
      at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:558)
      at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524)
      at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.loadHttpMethod(ApacheHttpClient4Engine.java:423)
      at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:281)
      ... 11 more
  </code></pre>
  
  <p>I'm not sure what I'm doing wrong here. Has anyone run into this sort of issue before? Any help with this is greatly appreciated!</p>