title: org.springframework.http.converter.HttpMessageNotWritableException No converter found for return value of type: class
body: <p>I'm doing exercises with Spring-Boot, I tried to search, but nothing I've found worked for me. I'm trying to return a JSON converting a POJO, which SB is supposed to do it automatically, but it returns:</p>
  
  <blockquote>
    <p>2018-11-05 13:26:36.090  WARN 1584 --- [nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class com.example.demo.pelis.Foo]</p>
  </blockquote>
  
  <p>Here is my pom.xml:</p>
  
  <pre><code>  &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.1.0.RELEASE&lt;/version&gt;
      &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
    &lt;/parent&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&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-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.h2database&lt;/groupId&gt;
        &lt;artifactId&gt;h2&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;
  </code></pre>
  
  <p>And my POJO:</p>
  
  <pre><code>public class Foo {
  
      private String bar;
  
      /**
       * @return the bar
       */
      public String getBar() {
          return bar;
      }
  
      /**
       * @param bar
       *            the bar to set
       */
      public void setBar(String bar) {
          this.bar = bar;
      }
  }
  </code></pre>
  
  <p>The controller:</p>
  
  <pre><code>@RestController
  public class PelisController {
      @GetMapping(value = "/fooPoint")
      public Foo fooPoint() {
          Foo foo = new Foo();
          foo.setBar("smthng");
          return foo;
      }
  }
  </code></pre>
  
  <p>I don't know what I'm doing wrong, because I've tried getters/setters method, I tried to replace my pom with the one in the official guide. Nothing helped.</p>