Could not initialize class org.elasticsearch.ElasticsearchException at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2695) ~[elasticsearch-rest-high-level-client-7.17.10.jar:7.17.10]

I have an Elasticsearch exception I have created a simple API where I am using the reactive mongo repository to find the data from the DB and I am trying to send this data to Elasticsearch which save operation one by one. So could you please tell the issue.

@Bean(name = ["highLevelClient"], destroyMethod = "close")
fun client(): RestHighLevelClient? {
val restBuilder: RestClientBuilder = RestClient
.builder(
HttpHost(
host,
port.toInt(),
scheme
)
)
if ((username != null) and (password != null)) {
val creadential: CredentialsProvider = BasicCredentialsProvider()
creadential.setCredentials(AuthScope.ANY, UsernamePasswordCredentials(username, password))
restBuilder.setHttpClientConfigCallback { httpClientBuilder ->
httpClientBuilder.setDefaultCredentialsProvider(creadential)
.setDefaultIOReactorConfig(IOReactorConfig.custom().setIoThreadCount(1).build())
}
restBuilder.setRequestConfigCallback { requestConfigBuilder: RequestConfig.Builder ->
requestConfigBuilder.setConnectTimeout(connectionTimeOut.toInt()) // time until a connection with the server is established.
.setSocketTimeout(socketTimeOut.toInt()) // time of inactivity to wait for packets[data] to receive.
.setConnectionRequestTimeout(connReqTimeOut.toInt())
} // time to fetch a connection from the connection pool 0 for infinite.
return RestHighLevelClient(restBuilder)
}
return null
}

this is my configuration to set up Elasticsearch.

Please tell me if you want any other code.

Welcome !

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.

Also provide the full stacktrace please.

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