Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

java.lang.IllegalArgumentException: Class class co.elastic.clients.elasticsearch.core.bulk.UpdateOperation cannot be read from JSON

Open
#477 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
elasticsearch, java

Research direction

Start by reproducing the exception from the supplied BulkOperation and UpdateOperation builder snippet using the reported Elasticsearch Java Client 8.5.3 or 8.4.1 and JDK 11. Inspect the withJson entry point and the JSON input shown in the attached example; done means the update operation can be read from JSON without the reported IllegalArgumentException.

Written by the indexing model from the issue text.

Description

Java API client version

8.5.3 and 8.4.1

Java version

jdk11

Elasticsearch Version

8.4.1

Problem description

java.lang.IllegalArgumentException: Class class co.elastic.clients.elasticsearch.core.bulk.UpdateOperation cannot be read from JSON

StringReader reader = new StringReader(json);
            BulkOperation updateOp = new BulkOperation.Builder()
                            .update(new UpdateOperation.Builder<>()
                            .index(topic)
                            .id("1")
                            .withJson(reader)
                            .retryOnConflict(Math.min(1, 5))
                            .build())
                    .build();

image
image

Dominant language
Java
Stars
524
Forks
299
Avg merge
16m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/elasticsearch-java

All issues in elastic/elasticsearch-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.