# Using Java api client with json method not found error in 7.17.1

**URL:** <https://discuss.elastic.co/t/using-java-api-client-with-json-method-not-found-error-in-7-17-1/314825>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 21, 2022, 4:54am UTC](https://discuss.elastic.co/t/using-java-api-client-with-json-method-not-found-error-in-7-17-1/314825 "2022-09-21T04:54:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghunandan](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Raghunandan](https://discuss.elastic.co/u/Raghunandan)\
**Post date:** [September 21, 2022, 4:54am UTC](https://discuss.elastic.co/t/using-java-api-client-with-json-method-not-found-error-in-7-17-1/314825/1 "2022-09-21T04:54:51Z")

</div>

Not able to find withJson method in any of elasticsearch request and response in version 7.17.1 where it is mentioned in all documentation. If there is no way to use it , what alternative can be used in 7.17.1 to use json string into requests from elasticsearch java api client

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [September 21, 2022, 7:27am UTC](https://discuss.elastic.co/t/using-java-api-client-with-json-method-not-found-error-in-7-17-1/314825/2 "2022-09-21T07:27:46Z")

</div>

Version 7.17 is a long term support release, and along with bug fixes we backport some important new features to it. You should update your project to use version 7.17.6, the latest release in that branch. It has the `withJson` feature.

---

<div class="post-metadata">

**Author:** ![Raghunandan](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Raghunandan](https://discuss.elastic.co/u/Raghunandan)\
**Post date:** [September 21, 2022, 11:23am UTC](https://discuss.elastic.co/t/using-java-api-client-with-json-method-not-found-error-in-7-17-1/314825/3 "2022-09-21T11:23:06Z")

</div>

Is there no other way to use in 7.17.1?  
as for for version upgrade it would be long procedure and do breaking changes along with it for the minor upgrades , so is there any other solution available as i was getting this error while directly mapping my document class object in .doc field _jakarta.json.JsonException: Jackson exception_

only for confirmation, if we upgrade client to 7.17.6 and server as it is on 7.17.1 will it be compatible

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [September 21, 2022, 12:29pm UTC](https://discuss.elastic.co/t/using-java-api-client-with-json-method-not-found-error-in-7-17-1/314825/4 "2022-09-21T12:29:04Z")

</div>

> [@Raghunandan](#):
>
> Is there no other way to use in 7.17.1

Unfortunately no. Now this only requires to upgrade the _client_ library. And yes will work fine with server 7.17.1.

---

<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:** [October 19, 2022, 12:29pm UTC](https://discuss.elastic.co/t/using-java-api-client-with-json-method-not-found-error-in-7-17-1/314825/5 "2022-10-19T12:29:24Z")

</div>

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