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:
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:
@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:
public RestClientTransport(RestClient restClient, JsonpMapper mapper, @Nullable TransportOptions options)
Where as in 8.9.0 the contructor of RestClientTransport has a different contructor:
public RestClientTransport(RestClient restClient, JsonpMapper jsonpMapper, RestClientOptions options)
As a workaround this works:
@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.