flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 徐涛 <happydexu...@gmail.com>
Subject ElasticSearch RestClient throws NoSuchMethodError due to shade mechanism
Date Tue, 15 Jan 2019 10:36:30 GMT
Hi All,
	I use the following code try to build a RestClient
	org.elasticsearch.client.RestClient.builder(  new HttpHost(xxx, xxx,"http")  ).build()
	but when in running time, a NoSuchMethodError throws out, I think the reason is:
	There are two RestClient classes, one is in the jar I include, the other one is in flink-connector-elasticsearch5,
but the argument of build method in flink-connector-elasticsearch5 is org.apache.flink.streaming.connectors.elasticsearch5.shaded.org.apache.http.HttpHost.
So I want to know why org.elasticsearch.client.RestClientBuilder is not shaded, so runtime
class conflict could be avoided?

        public static RestClientBuilder builder(org.apache.flink.streaming.connectors.elasticsearch5.shaded.org.apache.http.HttpHost...
hosts) {
            return new RestClientBuilder(hosts);
        }

Best
Henry
Mime
View raw message