title: GWT JPA - The response could not be deserialized
body: <p>I use GWT and JPA for persistence. I have created a domain JPA enchanted classes, DAO's and RPC for communication between them. Everything works fine, through RPC the client sends the object to server but could not get response. Server cannot deserialize in a compatible way with the client side. So i cannot use the server callBack back to the client. The exception message is this:</p>
  
  <blockquote>
    <p>The response could not be
    deserialized,
    com.google.gwt.user.client.rpc.SerializationException</p>
  </blockquote>
  
  <p>Here's a sample code of one of my classes:</p>
  
  <pre><code>@Entity
  @Table(name="course")
  public class Course implements Serializable {
      private static final long serialVersionUID = 1L;
      private int courseId;
      private String name;
      private List&lt;Group&gt; groups;
      private List&lt;Module&gt; modules;
  
      public Course() {
      }
  
  
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      @Column(unique=true, nullable=false)
      public int getCourseId() {
          return this.courseId;
      }
  
      public void setCourseId(int courseId) {
          this.courseId = courseId;
      }
  
  
      @Column(nullable=false, length=100)
      public String getName() {
          return this.name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
  
      //bi-directional many-to-one association to Group
      @OneToMany(mappedBy="course", fetch=FetchType.LAZY)
      public List&lt;Group&gt; getGroups() {
          return this.groups;
      }
  
      public void setGroups(List&lt;Group&gt; groups) {
          this.groups = groups;
      }
  
  
      //bi-directional many-to-one association to Module
      @OneToMany(mappedBy="course", fetch=FetchType.LAZY)
      public List&lt;Module&gt; getModules() {
          return this.modules;
      }
  
      public void setModules(List&lt;Module&gt; modules) {
          this.modules = modules;
      }
  
  }
  </code></pre>
  
  <ul>
  <li>If i remove the relationships it work's fine. This is done because collections like lists, set's e.t.c are converted into hibernate objects that cannot be handled by GWT client side.</li>
  </ul>