title: How to produce json response that consumes json object using spring and Hibernate
body: <p>I am getting 415 Error.
  This is my mapping used for getting the json response</p>
  
  <pre><code>@RequestMapping(value="/details", method= RequestMethod.POST ,
          consumes= MediaType.APPLICATION_JSON_VALUE ,
          produces= MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity&lt;UserDetails&gt; addUserDetails(@RequestBody 
                  RegisterInput registerInput)throws ValidationException{
  
      if(registerInput==null || registerInput.getUserName()==null){
                  throw new ValidationException("Input is not valid");
      }
      UserDetails userDetails=new UserDetails(registerInput.getUserName(),
                      registerInput.getFirstName(), registerInput.getLastName(), registerInput.getPassword());
      userDetailsService.addUserDetails(userDetails);
      return new ResponseEntity&lt;UserDetails&gt;(userDetails, HttpStatus.OK);
  }
  </code></pre>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
      &lt;version&gt;1.9.13&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-core-asl&lt;/artifactId&gt;
      &lt;version&gt;1.9.13&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
      &lt;version&gt;2.4.4&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
      &lt;version&gt;2.4.4&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
      &lt;version&gt;2.4.4&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Help me with how to get the json response as it says error 415 in my case.
  Thanks in advance</p>
  
  <p>where UserDetails is the POJO class and RegisterInput is to store the input and return json object. The following is my pom.</p>