NoSuchMethodError for client.updateByQuery(...)

See org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.elasticsearch.action.index.IndexRequest.ifSeqNo()J

When using @springboot 2.1+ with
elasticsearch, you need to be explicit with some transitive dependencies as SpringBoot forces a version 6.4...

Basically add this to your project to workaround the problem

Another way is documented at: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-customize-dependency-versions

You can put this in your pom.xml:

<properties>
  <elasticsearch.version>7.0.0<elasticsearch.version>
</properties>
1 Like