# java.lang.NoSuchMethodError: org.elasticsearch.common.settings.Settings$Builder.put(\[Ljava/lang/Object;)

**URL:** https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553
**Category:** Elasticsearch
**Created:** [October 15, 2018, 7:46pm UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553 "2018-10-15T19:46:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Kstays](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@Kstays](https://discuss.elastic.co/u/Kstays)
#### Post date: [October 15, 2018, 7:46pm UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553/1 "2018-10-15T19:46:22Z")

</div>

Hi,  
I am upgrading from ES version 2.x to 6.4.2 and am getting this error while server startup. I am using spring boot version 2.0.5 and have included the 6.4.2 version of ES libraries.

```
	Settings settings = Settings.builder()
		.put("transport.ping_schedule", "5s")
		.put("cluster.name", clusterId)
		.put("request.headers.X-Found-Cluster", clusterId)
		.put("xpack.security.user", userPass)
		.build();

		return new PreBuiltXPackTransportClient(settings)
			.addTransportAddress(new TransportAddress(InetAddress.getByName(hostname), port));

```

Here is the detailed message:

```
	WARN 3714 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myIncidentsService': Unsatisfied dependency expressed through field 'customerIncidentRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerIncidentRepository': Cannot resolve reference to bean 'elasticsearchTemplate' while setting bean property 'elasticsearchOperations'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'elasticsearchTemplate' defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.class]: Unsatisfied dependency expressed through method 'elasticsearchTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'client' defined in class path resource [com/gmp/bootes/elasticsearch/config/ElasticSearchConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.elasticsearch.client.Client]: Factory method 'client' threw exception; nested exception is java.lang.NoSuchMethodError: org.elasticsearch.common.settings.Settings$Builder.put([Ljava/lang/Object;)Lorg/elasticsearch/common/settings/Settings$Builder;

```

Any ideas? Happy to provide more information if required.  
Thank you !  
Kriss

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [October 16, 2018, 3:06am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553/2 "2018-10-16T03:06:38Z")

</div>

The `Settings.Builder.put(Object ... settings)` method was removed in Elasticsearch 6.1.0

Something in your app is trying to call it, but it doesn't exist anymore.  
My best guess is that you have a mix of different versions of ES jars in your application, but it's hard to diagnose anything from a spring error like that.

---

<div class="post-metadata">

### Author: ![Kstays](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@Kstays](https://discuss.elastic.co/u/Kstays)
#### Post date: [October 16, 2018, 2:51pm UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553/3 "2018-10-16T14:51:26Z")

</div>

This method

```
    public Settings.Builder put(Settings settings) {
        return this.put(settings, true);
    }

```

seems to be present in

`org.elasticsearch.common.settings.Settings` class in the elasticsearch-6.4.2.jar ?

Am I missing something?

Thank you!!

---

<div class="post-metadata">

### Author: ![Kstays](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@Kstays](https://discuss.elastic.co/u/Kstays)
#### Post date: [October 16, 2018, 3:35pm UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553/4 "2018-10-16T15:35:54Z")

</div>

> [@Kstays](#):
>
> [Ljava/lang/Object;

A more basic question being, do you know if Elasticsearch 6.4.2 will work with the latest (or any) version of Spring Boot ?

Thank you again !!

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [October 17, 2018, 4:26am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553/5 "2018-10-17T04:26:52Z")

</div>

Yes, this method exists

```auto
public Settings.Builder put(Settings settings)

```

but the signature in your error is:

```auto
org.elasticsearch.common.settings.Settings$Builder
.put(
[Ljava/lang/Object;
)
Lorg/elasticsearch/common/settings/Settings$Builder;

```

which is

```auto
public Settings.Builder put(Object ... settings)

```

And that method was removed in 6.1.0

The procedure for demangling the signature is:

- The first part is the class that contains the method
- Followed by a '.'
- Then the name of the method
- Then the arguments in brackets
- Then the return type

For the return type & argument types,

- `[` indicates an array
- `L` indicates a class, with the class name immediately following terminated with ';'
- Class names use '/' rather than '.' for their hierarchy.

So `[Ljava/lang/Object;` is `java.lang.Object[]`

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [October 17, 2018, 4:27am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553/6 "2018-10-17T04:27:34Z")

</div>

> [@Kstays](#):
>
> A more basic question being, do you know if Elasticsearch 6.4.2 will work with the latest (or any) version of Spring Boot ?

I cannot see why it wouldn't be.

Have you actually checked whether you have consistent versions of the ES jars on your classpath?

---

<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: [November 14, 2018, 4:27am UTC](https://discuss.elastic.co/t/java-lang-nosuchmethoderror-org-elasticsearch-common-settings-settings-builder-put-ljava-lang-object/152553/7 "2018-11-14T04:27:35Z")

</div>

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