title: Why am I getting org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type
body: <p>Can someone please tell me Why am I getting org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type error?</p>
  
  <p>Here is my call:</p>
  
  <pre><code>try
          {
              String jsonreturn = restTemplate.getForObject("http://" + mRESTServer.getHost() + ":8080/springmvc-rest-secured-test/json/{name}", String.class, vars);
              LOGGER.debug("return object:  " + jsonreturn.toString());
          } catch (HttpClientErrorException e)
          {
              /**
               *
               * If we get a HTTP Exception display the error message
               */
  
              LOGGER.error("error:  " + e.getResponseBodyAsString());
  
              ObjectMapper mapper = new ObjectMapper();
              ErrorHolder eh = mapper.readValue(e.getResponseBodyAsString(), ErrorHolder.class);
  
              LOGGER.error("error:  " + eh.errorMessage);
  
          }
  </code></pre>
  
  <p>which I am trying to test the error so I should be creating a ErrorHolder Object but I am getting the error;</p>
  
  <p>Here is my ErrorHolder class:</p>
  
  <pre><code>public class ErrorHolder
  {
  
  
      public String errorMessage;
  
      public ErrorHolder(String errorMessage)
      {
          this.errorMessage = errorMessage;
      }
  
      public String getErrorMessage()
      {
          return errorMessage;
      }
  
      public void setErrorMessage(String errorMessage)
      {
          this.errorMessage = errorMessage;
      }
  
      @Override
      public String toString()
      {
          return "ErrorHolder{" +
                  "errorMessage='" + errorMessage + '\'' +
                  '}';
      }
  }
  </code></pre>
  
  <p>I dont know why I am getting the following error:</p>
  
  <pre><code>2013-06-12 14:36:32,138 [main] ERROR Main - error:  {"errorMessage":"Uh oh"}
  Exception in thread "main" org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class ErrorHolder]: can not instantiate from JSON object (need to add/enable type information?)
   at [Source: java.io.StringReader@628016f7; line: 1, column: 2]
  </code></pre>