# Caused by: java.lang.NoSuchMethodError: 'void co.elastic.clients.transport.rest\_client.RestClientTransport.\<init\>

**URL:** <https://discuss.elastic.co/t/caused-by-java-lang-nosuchmethoderror-void-co-elastic-clients-transport-rest-client-restclienttransport-init/339573>\
**Category:** Elasticsearch\
**Tags:** docker, language-clients, runtime-fields\
**Created:** [July 28, 2023, 4:18pm UTC](https://discuss.elastic.co/t/caused-by-java-lang-nosuchmethoderror-void-co-elastic-clients-transport-rest-client-restclienttransport-init/339573 "2023-07-28T16:18:02Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![ewolfman](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@ewolfman](https://discuss.elastic.co/u/ewolfman)\
**Post date:** [August 2, 2023, 12:04pm UTC](https://discuss.elastic.co/t/caused-by-java-lang-nosuchmethoderror-void-co-elastic-clients-transport-rest-client-restclienttransport-init/339573/9 "2023-08-02T12:04:08Z")

</div>

UPDATE: After further investigation, I think the problem might be some incompatibility between org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchClientConfigurations and the 8.9.0 RestClientTransport.  
The exception is:

```auto
2023-08-02T11:29:44.733Z <> {index=1286,scope=,engagement=,session=,request=,span=,thread=main} DEBUG: [o.s.b.d.LoggingFailureAnalysisReporter] Application failed to start due to an exceptio
n
java.lang.NoSuchMethodError: 'void co.elastic.clients.transport.rest_client.RestClientTransport.<init>(org.elasticsearch.client.RestClient, co.elastic.clients.json.JsonpMapper, co.elastic.cl
ients.transport.TransportOptions)'
        at org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchClientConfigurations$ElasticsearchTransportConfiguration.restClientTransport(ElasticsearchClientConfigurations.ja
va:90)

```

And digging into the code of ElasticsearchClientConfigurations:

```auto
    @Import({JacksonJsonpMapperConfiguration.class, JsonbJsonpMapperConfiguration.class, SimpleJsonpMapperConfiguration.class})
    @ConditionalOnBean({RestClient.class})
    @ConditionalOnMissingBean({ElasticsearchTransport.class})
    static class ElasticsearchTransportConfiguration {
        ElasticsearchTransportConfiguration() {
        }

        @Bean
        RestClientTransport restClientTransport(RestClient restClient, JsonpMapper jsonMapper, ObjectProvider<TransportOptions> transportOptions) {
            return new RestClientTransport(restClient, jsonMapper, (TransportOptions)transportOptions.getIfAvailable());
        }
    }

```

The 8.8.2 contructor of RestClientTransport is compatible with the spring boot autoconfigurer:

```auto
    public RestClientTransport(RestClient restClient, JsonpMapper mapper, @Nullable TransportOptions options) 

```

Where as in 8.9.0 the contructor of RestClientTransport has a different contructor:

```auto
    public RestClientTransport(RestClient restClient, JsonpMapper jsonpMapper, RestClientOptions options)

```

As a workaround this works:

```auto
@SpringBootApplication(exclude = org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchClientAutoConfiguration.class )

```

But I think that the solution should be by fixing the 8.9.x java client.

---

_[View the full topic](https://discuss.elastic.co/t/caused-by-java-lang-nosuchmethoderror-void-co-elastic-clients-transport-rest-client-restclienttransport-init/339573)._
