title: MessageBodyWriter error caused by CascadeType
body: <p>There is an webservice running in two systems:</p>
  
  <ol>
  <li>Windows 7 x64, Apache Tomcat/8.5.16, JVM 1.8.0_65-b17 </li>
  <li>Ubuntu 16.04.2 LTS, Apache Tomcat/8.5.15, JVM 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11</li>
  </ol>
  
  <p>The webservice looks like:</p>
  
  <pre><code>public class Order implements Serializable {
  
      @OneToMany(cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE, CascadeType.DETACH}, mappedBy = "orderId")
      private List&lt;Item&gt; itemList;
  
      // getters and setters
  
  }
  
  ... 
  
  public class Item implements Serializable {
  
      @JoinColumn(name = "order_id", referencedColumnName = "id")
      @ManyToOne(optional = false)
      @XmlJavaTypeAdapter(OrderAdapter.class)
      private Order orderId;
  
      // getters and setters
  }
  
  ... 
  
  @GET
  @Produces({"application/xml", "application/json"})
  public List&lt;Order&gt; findAll(@HeaderParam("authorization") String authString) throws Exception {
  
      Query q = em.createNativeQuery("SELECT * FROM order", Order.class);
      return q.getResultList();
  
  }
  </code></pre>
  
  <p>Problem: The webservice runs ok in the first server, no errors. In second server i got the error:</p>
  
  <blockquote>
    <p>org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException:
    MessageBodyWriter not found for media type=application/xml, type=class
    java.util.Vector, genericType=java.util.List</p>
  </blockquote>
  
  <p>The webservice only works in second server if I change the line:</p>
  
  <pre><code>@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE, CascadeType.DETACH}, mappedBy = "orderId")
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>@OneToMany(cascade = CascadeType.ALL, mappedBy = "orderId")
  </code></pre>
  
  <p>So, why the same webservice runs ok in first server and causes error in second? And what is relation with MessageBodyWriter and CascadeType?</p>