title: dropwizard-giving-400-error-when-creating-new-resource using POST
body: <pre><code>public class UserProfileData {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private long id;
  
      @Column(name = "firstName", nullable = false)
      private String firstName;
  
      @Column(name = "lastName", nullable = true)
      private String lastName;
  
      @Column(name = "country", nullable = true)
      private String country;
  
      public UserProfileData() {
      }
  
      public UserProfileData(String firstName, String lastName, String country) {
          this.firstName = firstName;
          this.lastName = lastName;
          this.country = country;
      }
  
  
      public long getId() {
          return id;
      }
  
  
      public void setObjectId(long id) {
          this.id = id;
      }
  
      @JsonProperty
      public String getFirstName() {
          return firstName;
      }
  
      @JsonProperty
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  
      @JsonProperty
      public String getLastName() {
          return lastName;
      }
  
      @JsonProperty
      public void setLastName(String lastName) {
          this.lastName = lastName;
      }
  
      @JsonProperty
      public String getCountry() {
          return country;
      }
  
      @JsonProperty
      public void setCountry(String country) {
          this.country = country;
      }
  
      @Override
      public boolean equals(Object o) {
          if (this == o) return true;
          if (!(o instanceof UserProfileData)) return false;
  
          final UserProfileData that = (UserProfileData) o;
  
          return Objects.equals(this.id, that.id) &amp;&amp;
                  Objects.equals(this.firstName, that.firstName) &amp;&amp;
                  Objects.equals(this.lastName, that.lastName) &amp;&amp;
                  Objects.equals(this.country, that.country);
      }
  
      @Override
      public int hashCode() {
          return Objects.hash(id, firstName, lastName, country);
      }
  }
  
  ========================================================================
  
  DAO Method
  
     public UserProfileData create(UserProfileData userProfileData) {
          LOGGER.info("UserProfileData: Persisting New User");
          return persist(userProfileData);        
      }
  
  =======================================================================
  
  Resource Call
  @Path("/user")
  @Produces(MediaType.APPLICATION_JSON)
  public class UserProfileDataResource {
  
   @POST
      @Path("/create")
      @Consumes(MediaType.APPLICATION_JSON)
      @UnitOfWork
      public UserProfileData createUser(UserProfileData userProfileData) {
          //ResourceHelper.checkRequiredParams(requesterId);
          LOGGER.info("User created");
          return userProfileDataDAO.create(userProfileData);
      }
  ======================================================================
  </code></pre>
  
  <p>when i call the resource using to create a new User Data, it gives me error</p>
  
  <blockquote>
    <p>curl -H "Content-Type: application/json" -X POST -d
    "{"firstName":"Sachin","lastName":"Tendulkar","country":"India"}"
    <a href="http://localhost:8080/user/create" rel="nofollow">http://localhost:8080/user/create</a></p>
    
    <p>Error: {"code":400,"message":"Unable to process JSON","details":null}</p>
  </blockquote>
  
  <p>Tried with almost everything but not able to figure out why this error is coming and how to resolve it ?</p>