# Elasticsearch method not being found in spring boot

**URL:** <https://discuss.elastic.co/t/elasticsearch-method-not-being-found-in-spring-boot/235093>\
**Category:** Elasticsearch\
**Created:** [May 31, 2020, 9:25pm UTC](https://discuss.elastic.co/t/elasticsearch-method-not-being-found-in-spring-boot/235093 "2020-05-31T21:25:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![momo94](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@momo94](https://discuss.elastic.co/u/momo94)\
**Post date:** [May 31, 2020, 9:25pm UTC](https://discuss.elastic.co/t/elasticsearch-method-not-being-found-in-spring-boot/235093/1 "2020-05-31T21:25:49Z")

</div>

Hello All. I am really glad I found this discussion forum.

I have been stuck with this issue for a while now and any assistance is appreciated. I am running Spring Boot version `2.2.0` with the ElasticSearch high-level REST Client version `6.4.3` and using version `3.2.0` for the Spring-Data-Elasticsearch version. I am getting the error below. I have tried the following attempts to fix but none do.

```
1. Change Spring Boot Version multiple times
2. Change ES version multiple times
3. I have cleared my .m2 folder and redownloaded the maven dependencies multiple times.

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.putMapping(ElasticsearchRestTemplate.java:292)

The following method did not exist:

    org.elasticsearch.client.IndicesClient.putMapping(Lorg/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest;Lorg/elasticsearch/client/RequestOptions;)Lorg/elasticsearch/action/support/master/AcknowledgedResponse;

The method's class, org.elasticsearch.client.IndicesClient, is available from the following locations:

    jar:file:/Users/user/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/6.4.3/elasticsearch-rest-high-level-client-6.4.3.jar!/org/elasticsearch/client/IndicesClient.class

It was loaded from the following location:

    file:/Users/user/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/6.4.3/elasticsearch-rest-high-level-client-6.4.3.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.client.IndicesClient

```

My POM is below

```
 <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-elasticsearch</artifactId>
        <version>3.2.0</version>
    </dependency>

```

Any help is appreciated. I am sure it has to deal with compatibility issues but not sure which. Thanks all!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 1, 2020, 9:42am UTC](https://discuss.elastic.co/t/elasticsearch-method-not-being-found-in-spring-boot/235093/2 "2020-06-01T09:42:41Z")

</div>

Welcome!

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

Basically you can put this in your `pom.xml`:

```auto
<properties>
  <elasticsearch.version>7.7.0<elasticsearch.version>
</properties>

```

See documentation here: [https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-customize-dependency-versions](https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-customize-dependency-versions)

---

<div class="post-metadata">

**Author:** ![momo94](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@momo94](https://discuss.elastic.co/u/momo94)\
**Post date:** [June 3, 2020, 5:55pm UTC](https://discuss.elastic.co/t/elasticsearch-method-not-being-found-in-spring-boot/235093/3 "2020-06-03T17:55:10Z")

</div>

I was able to get it work. Thanks for your reply @dadoonet

---

<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 1, 2020, 5:55pm UTC](https://discuss.elastic.co/t/elasticsearch-method-not-being-found-in-spring-boot/235093/4 "2020-07-01T17:55:18Z")

</div>

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