Hi,
I am working on implementing Low Level Rest Client.
I am facing issues with Initialising RestClient.
The dependency in pom.xml is :
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>6.4.3</version>
</dependency>
Initialisation of RestClient is :
RestClient restClient =RestClient.builder( new HttpHost("10.50.1.100", 9998, "http")).build();
This particular line of code is throwing an ClassNotFoundException
To be specific -
SEVERE: Servlet.service() for servlet [elasticsearch] in context with path [/ElasticSearch] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/http/conn/util/PublicSuffixMatcherLoader] with root cause
java.lang.ClassNotFoundException: org.apache.http.conn.util.PublicSuffixMatcherLoader
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at org.apache.http.impl.nio.client.HttpAsyncClientBuilder.build(HttpAsyncClientBuilder.java:640)
at org.elasticsearch.client.RestClientBuilder$2.run(RestClientBuilder.java:230)
at org.elasticsearch.client.RestClientBuilder$2.run(RestClientBuilder.java:227)
at java.security.AccessController.doPrivileged(Native Method)
at org.elasticsearch.client.RestClientBuilder.createHttpClient(RestClientBuilder.java:227)
at org.elasticsearch.client.RestClientBuilder.access$000(RestClientBuilder.java:42)
at org.elasticsearch.client.RestClientBuilder$1.run(RestClientBuilder.java:198)
at org.elasticsearch.client.RestClientBuilder$1.run(RestClientBuilder.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at org.elasticsearch.client.RestClientBuilder.build(RestClientBuilder.java:195)
I am sure I am missing something very basic here.
Where am I going wrong?