From user-return-25341-archive-asf-public=cust-asf.ponee.io@flink.apache.org Tue Jan 15 11:39:58 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E78F7180609 for ; Tue, 15 Jan 2019 11:39:57 +0100 (CET) Received: (qmail 63728 invoked by uid 500); 15 Jan 2019 10:39:56 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@flink.apache.org Received: (qmail 63718 invoked by uid 99); 15 Jan 2019 10:39:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2019 10:39:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 387EAC8DEC for ; Tue, 15 Jan 2019 10:39:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.902 X-Spam-Level: * X-Spam-Status: No, score=1.902 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_EXCESS_BASE64=0.105, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id LCLUFyehLjjT for ; Tue, 15 Jan 2019 10:39:54 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DAD575F300 for ; Tue, 15 Jan 2019 10:39:53 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id q1so1132944pfi.5 for ; Tue, 15 Jan 2019 02:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=NWFTgZ00+acaFFecKF2msjoyaUmX4FjAXGy53r7ZE2c=; b=rzdGojX8hfxi/TMJPDJVIBaSKDp1OVZBkFYj11x1irayR83x7sQFyNRYCxqUPCoZu4 y7bNotiJlr5erVbmxJWrOsMGXZW6orvksHVB6cd567cyKGWss+wpLLvSEWOoDnJ9kKmK 71TFXRhQF9jQfBQnq0ZBFVrwfd24pnxEzD3aSNnVEwh1tWOtCLGiLQeDBRP3iQPIM/La 6o8L5YPVBGZW5kPRI3ow7XsUHi0Se4iLn7G1O/swgK/WRKvwVLc8N+9k74YDQgEFeB45 IMBT9zHGqLj1MBXQiS1SRWU1w5Dxh2N+OjWVtkPD7M+004YU8V+N4K6068WzgUNeMF9Q pr3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=NWFTgZ00+acaFFecKF2msjoyaUmX4FjAXGy53r7ZE2c=; b=SbnpGMZ1I9ah5doPjEKLGLM1V/Cb0RXEpMPCrG5msqM+8Wi+clw5cT2ALEfSk41Jwb iDwxEDRwySejrpSxVoG+VZPdJcvLt1ktxroXYbaBkV5tYEaKRC8H9AYrCXPaf9YC63fh 54vmMwtsGWDNnoe5zg+oNckzhOGOuWHGJGtxdsq9lal+xUbW60PlHojvbBOOsORt8ILb E9OtB3epxiGo4Xk8/TjQY30dL+ob1yWE7fimFSLTjxZmnw5ZdwAbcbFuIteEUX1tAyGg Xjwy58VfZJIsDVZ4PVy/LcFqtylR7OZC/gCGw5bF8SjG4PRjcPnmpJWbyiReW3B75AUB paZw== X-Gm-Message-State: AJcUukfqLjyZTYxc4HrfW+2JHU15u3qso5z6brnHV8NZysRAxvnI6Jj9 U1JoGhILWlw8KMm6bQ8Lp7MEDk1V X-Google-Smtp-Source: ALg8bN5LYyqxOklXTIzYaSPuVxXV/ly/9Z4iSri4ZAwLEL3w/x7aM+sQvFRpRl4vIPppLvcULwFuwA== X-Received: by 2002:a62:6f88:: with SMTP id k130mr3311175pfc.234.1547548791831; Tue, 15 Jan 2019 02:39:51 -0800 (PST) Received: from [192.168.75.0] ([124.74.245.251]) by smtp.gmail.com with ESMTPSA id f13sm4293722pfa.132.2019.01.15.02.39.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 02:39:51 -0800 (PST) From: =?gb2312?B?0OzMzg==?= Content-Type: multipart/alternative; boundary="Apple-Mail=_B39C55FA-5662-4162-9861-0117BACBFADA" Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: ElasticSearch RestClient throws NoSuchMethodError due to shade mechanism Message-Id: <74FAA408-87CF-46BE-B5BC-4D4643E58596@gmail.com> Date: Tue, 15 Jan 2019 18:36:30 +0800 To: user X-Mailer: Apple Mail (2.3445.100.39) --Apple-Mail=_B39C55FA-5662-4162-9861-0117BACBFADA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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.htt= p.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.ap= ache.http.HttpHost... hosts) { return new RestClientBuilder(hosts); } Best Henry= --Apple-Mail=_B39C55FA-5662-4162-9861-0117BACBFADA Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii 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.htt= p.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.ap= ache.http.HttpHost... hosts) {
            return new = RestClientBuilder(hosts);
  =       }

Best
Henry
= --Apple-Mail=_B39C55FA-5662-4162-9861-0117BACBFADA--