title: Spark Java IllegalArgumentException: class org.eclipse.jetty.server.handler.ErrorHandler declares multiple JSON fields named _listeners
body: <p>I'm developing a simple project using Java Spark, and at the moment I'm trying to implement a little RESTful service. I have this post method:</p>
  
  <pre><code>post("/users", (request, response) -&gt; {
          response.type("application/json");
          User user = new Gson().fromJson(request.body(),User.class);
          userService.addUser(user);
          return new Gson().toJson(response);
      });
  </code></pre>
  
  <p>I'm using postman to specify the body of the request:</p>
  
  <pre><code>{   "id": "1012", 
  "name": "Mac",
  "lastname": "Mason1",
  "email": "email"
  }
  </code></pre>
  
  <p>And the User class is:</p>
  
  <pre><code> public class User {
  
  public int id;
  public String name;
  public String lastname;
  public String email;
  
  public User (int id, String name, String lastname, String email) {
      this.id = id;
      this.name = name;
      this.lastname = lastname;
      this.email = email;
  }
  </code></pre>
  
  <p>Whenever I try to do a post request, the following error pops up:</p>
  
  <pre><code>ERROR spark.http.matching.GeneralError - 
  java.lang.IllegalArgumentException: class 
  org.eclipse.jetty.server.handler.ErrorHandler declares multiple JSON fields 
  named _listeners
  </code></pre>