title: Spring Boot: Failed .. write HTTP message: springframework.http.converter.HttpMessageNotWritableException
body: <p>I am writing a simple spring boot REST API for fun. Spring boot is new for me. By call the "/search" i get following exception:</p>
  
  <p>Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class java.util.LinkedHashMap</p>
  
  <p><strong>My Code:</strong></p>
  
  <p>@PostMapping("/search")
      public ResponseEntity getSearchResultViaAjax(@Valid @RequestBody SearchCriteria search, Errors errors) {</p>
  
  <pre><code>   ResponseBody result = new ResponseBody();
  
      //If error, just return a 400 bad request, along with the error message
      if (errors.hasErrors()) {
  
          result.setMsg(errors.getAllErrors().stream().map(x -&gt; x.getDefaultMessage()).collect(Collectors.joining(",")));
          return ResponseEntity.badRequest().body(result);
  
      }
  
      List&lt;User&gt; users = userService.findByUserNameOrEmail(search.getUsername());
      if (users.isEmpty()) {
          result.setMsg("no user found!");
      } else {
          result.setMsg("success");
      }
      result.setResult(users);
  
      return ResponseEntity.ok(result);
  
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated. </p>
  
  <p>Thanks in advance!</p>