RestHighLevelClient HTTP dependency problem


(blasearch) #1

Well, the RestHighLevelClient doesn't work either..

Here is the stack trace:

Caused by: 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)

Here is the code it crashes on:

RestClientBuilder restClientBuilder = RestClient.builder(new HttpHost(this.clusterHost, this.clusterPort, this.clusterScheme));
lazy_client = new RestHighLevelClient(restClientBuilder);

Here is my POM file:

<!-- for content searching -->
<dependency>
   <groupId>org.elasticsearch</groupId>
   <artifactId>elasticsearch</artifactId>
   <version>6.0.1</version>
</dependency>

<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>elasticsearch-rest-high-level-client</artifactId>
    <version>6.0.1</version>
</dependency>

<!-- https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.0/_maven_repository.html -->
<dependency>
   <groupId>org.elasticsearch.client</groupId>
   <artifactId>elasticsearch-rest-client-sniffer</artifactId>
   <version>6.0.1</version>
</dependency>

Any help is appreciated!

I've fixed this but don't know how to delete a post.


(blasearch) #2

Oops, another lib pulled in an old version of the apache http client.


(system) #3

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