title: No converter found for return value of type: class org.json.JSONObject
body: <p>Am writing Spring Boot rest service to get products from elastic search based on _id ( from elastic search ). Am able to print the response from the service, means service able to fetch but while converting to JSONObject to return back to UI its throwing below error</p>
  
  <p><code>No converter found for return value of type: class org.json.JSONObject</code></p>
  
  <p>Please find my code below.</p>
  
  <pre><code>public JSONObject getProductById(String id){
  
      String[] includes = new String[]{id};
      String[] excludes = Strings.EMPTY_ARRAY;
      GetRequest getRequest = new GetRequest(INDEX, TYPE, SOURCE);
      getRequest.routing(id);
  
      GetResponse getResponse = null;
      try {
          getResponse = restHighLevelClient.get(getRequest);
      } catch (java.io.IOException e){
          e.getLocalizedMessage();
      }
  
      //GetResponse getResponse = null;
  
      // create the search request
      SearchRequest searchRequest = new SearchRequest(INDEX); 
      searchRequest.types(TYPE);
  
      // create the match query on the author field
      SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
      MatchQueryBuilder matchQueryBuilder = new MatchQueryBuilder("_id", id); 
      searchSourceBuilder.query(matchQueryBuilder); 
      searchRequest.source(searchSourceBuilder);
  
      // send the request
      SearchResponse searchResponse = null;
      try {
           searchResponse = restHighLevelClient.search(searchRequest);
           logger.info("response ----&gt;"+searchResponse);
      } catch (IOException e) {
          e.getLocalizedMessage();
      }
      // read the response
      String productName = null;
      Product product = null;
      SearchHit[] searchHits = searchResponse.getHits().getHits();
      for (SearchHit hit : searchHits) {
          // get each hit as a Map
          Map&lt;String, Object&gt; sourceAsMap = hit.getSourceAsMap();
          product=new Product();
          product.setName(sourceAsMap.get("name").toString());
          /*productName = (String) sourceAsMap.get("name");*/
  
      }
  
      Gson gson=new Gson();
      JSONObject productJSON = null;
      String prodStr=gson.toJson(product);
      try {
          productJSON=new JSONObject(prodStr);
      } catch (JSONException e) { 
          e.printStackTrace();
      }
      return productJSON;
  }
  </code></pre>