title: Consuming a RESTful Web Service: Controller Springboot error
body: <p>i'm studying how to consume rest controller in spring, i'm using eclipse to run the java/spring , I want to ask i got error like this when running the java. i already tried to search about the caused,etc still dont find the solutions. anyone know how to fix it?</p>
  
  <pre><code>Exception in thread "main" org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class com.fasterxml.jackson.annotation.JsonIgnoreProperties$Value]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.fasterxml.jackson.annotation.JsonIgnoreProperties$Value` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
   at [Source: (PushbackInputStream); line: 1, column: 28] (through reference chain: hello.Quote["value"])
      at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:238)
      at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.read(AbstractJackson2HttpMessageConverter.java:223)
      at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:100)
      at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:725)
      at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:680)
      at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:332)
      at hello.Application.main(Application.java:15)
  Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.fasterxml.jackson.annotation.JsonIgnoreProperties$Value` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
   at [Source: (PushbackInputStream); line: 1, column: 28] (through reference chain: hello.Quote["value"])
      at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
      at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1451)
      at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1027)
      at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1290)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
      at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:369)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
      at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001)
      at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3072)
      at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:235)
      ... 6 more
  </code></pre>
  
  <p>My Application Java</p>
  
  <pre><code>package hello;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.web.client.RestTemplate;
  
  public class Application {
  
      private static final Logger log = LoggerFactory.getLogger(Application.class);
  
      public static void main(String args[]) {
          RestTemplate restTemplate = new RestTemplate();
          Quote quote = restTemplate.getForObject("http://gturnquist-quoters.cfapps.io/api/random", Quote.class);
          log.info(quote.toString());
      }
  
  }
  </code></pre>
  
  <p>Quote Java:</p>
  
  <pre><code>package hello;
  
  import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  import com.fasterxml.jackson.annotation.JsonIgnoreProperties.Value;
  
  @JsonIgnoreProperties(ignoreUnknown = true)
  public class Quote {
  
      private String type;
      private Value value;
  
      public Quote() {
      }
  
      public String getType() {
          return type;
      }
  
      public void setType(String type) {
          this.type = type;
      }
  
      public Value getValue() {
          return value;
      }
  
      public void setValue(Value value) {
          this.value = value;
      }
  
      @Override
      public String toString() {
          return "Quote{" +
                  "type='" + type + '\'' +
                  ", value=" + value +
                  '}';
      }
  }
  </code></pre>
  
  <p>Value Java</p>
  
  <pre><code>package hello;
  
  import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  
  
  @JsonIgnoreProperties(ignoreUnknown = true)
  
  public class Value {
  
      private Long id;
      private String quote;
  
      public Value() {
      }
  
      public Long getId() {
          return this.id;
      }
  
      public String getQuote() {
          return this.quote;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public void setQuote(String quote) {
          this.quote = quote;
      }
  
      @Override
      public String toString() {
          return "Value{" +
                  "id=" + id +
                  ", quote='" + quote + '\'' +
                  '}';
      }
  }
  </code></pre>
  
  <p>Pom XML :</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.resttemplate&lt;/groupId&gt;
    &lt;artifactId&gt;hello1&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;hello1 Maven Webapp&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.2.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
    &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&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;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>