# Unable to Parse response from elastic search in Java Spring Data Elasticsearch

**URL:** <https://discuss.elastic.co/t/unable-to-parse-response-from-elastic-search-in-java-spring-data-elasticsearch/306225>\
**Category:** Elasticsearch\
**Created:** [June 2, 2022, 12:30pm UTC](https://discuss.elastic.co/t/unable-to-parse-response-from-elastic-search-in-java-spring-data-elasticsearch/306225 "2022-06-02T12:30:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Waqas\_Rana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waqas_rana/32/106519_2.png) [@Waqas\_Rana](https://discuss.elastic.co/u/Waqas_Rana)\
**Post date:** [June 2, 2022, 12:30pm UTC](https://discuss.elastic.co/t/unable-to-parse-response-from-elastic-search-in-java-spring-data-elasticsearch/306225/1 "2022-06-02T12:30:16Z")

</div>

I am just creating/posting new entry that is created successful but while responding its getting issue of parsing .

` testRepository.save(application);`

I am not using any client because JavaHighlevel Rest client was deprecated in new . I am using latest spring boot and spring data Elasticsearch

`nested exception is java.lang.RuntimeException: Unable to parse response body for Response{requestLine=POST /vip/_doc?timeout=1m HTTP/1.1, host=http://localhost:9200, response=HTTP/1.1 201 Created}] with root cause`

```auto
{
  "name" : "Test",
  "cluster_name" : "Test",
  "cluster_uuid" : "Test",
  "version" : {
    "number" : "8.2.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "b174af62e8dd9f4ac4d25875e9381ffe2b9282c5",
    "build_date" : "2022-04-20T10:35:10.180408517Z",
    "build_snapshot" : false,
    "lucene_version" : "9.1.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

```

Can you advise please thanks

---

<div class="post-metadata">

**Author:** ![Waqas\_Rana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waqas_rana/32/106519_2.png) [@Waqas\_Rana](https://discuss.elastic.co/u/Waqas_Rana)\
**Post date:** [June 11, 2022, 8:30am UTC](https://discuss.elastic.co/t/unable-to-parse-response-from-elastic-search-in-java-spring-data-elasticsearch/306225/2 "2022-06-11T08:30:27Z")

</div>

I have created Elasticsearch Java ApI client and it solved problem as REST highlevel client is deprecated in new version .

```auto
 @Bean
    public ElasticsearchClient elasticsearchClient() {

        RestClient httpClient = RestClient.builder(new HttpHost("localhost", 9200)).build();

        ElasticsearchTransport transport = new RestClientTransport(httpClient, new JacksonJsonpMapper());

        ElasticsearchClient esClient = new ElasticsearchClient(transport);

        return esClient;
    }

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 9, 2022, 8:31am UTC](https://discuss.elastic.co/t/unable-to-parse-response-from-elastic-search-in-java-spring-data-elasticsearch/306225/3 "2022-07-09T08:31:11Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
