From user-return-33289-archive-asf-public=cust-asf.ponee.io@flink.apache.org Fri Mar 6 14:27:31 2020 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2B76B18057A for ; Fri, 6 Mar 2020 15:27:31 +0100 (CET) Received: (qmail 64154 invoked by uid 500); 6 Mar 2020 14:27:29 -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 64143 invoked by uid 99); 6 Mar 2020 14:27:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Mar 2020 14:27:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6D9511A31EA for ; Fri, 6 Mar 2020 14:27:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.252 X-Spam-Level: X-Spam-Status: No, score=0.252 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=0.2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id BKDPaoSZ4zZ4 for ; Fri, 6 Mar 2020 14:27:27 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.215.193; helo=mail-pg1-f193.google.com; envelope-from=wander4096@gmail.com; receiver= Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id DF902BB808 for ; Fri, 6 Mar 2020 14:27:26 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id d9so1168793pgu.3 for ; Fri, 06 Mar 2020 06:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eJVkUNZxX++ZGh7ONiDqDAqLxBK4WZLuHNIrE7BulEY=; b=h4NrZizNU0mSBtA0E/cFTjuYFFeiGEVc2jGtRXf6iJstu2MpyajJTXyn+gyxKxyi21 pvdGvao8v0ufmiUTe/U5mWEwml2/o1Wz7M7XhBYhO6y5nBxKs1alS2lDXpMf1r3Kd/yo zqXjKSHkVwrw0rMpX6X3Pm3bEPd6cjaNy6GGrKaVYYgfxIu5vOWs+bP8x/HcbKH8vgMR L3J0eBJXLHs7Ac8gOd5ZGCbFDPnpFB4cQv3R+S/rMx06mheqF6PttSu23dpN9N7zalKD hBAOz8aEt9eXsXe6ZLqKDs5tIko32ror/F72Nh1AQmXYsUN7c1BI5yenx1YtqceexI/g c0UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eJVkUNZxX++ZGh7ONiDqDAqLxBK4WZLuHNIrE7BulEY=; b=EF3ktJuLGcjE4SSTlFHjciUMw2HyS2r+gRnFagF5RUsum2DmndX/Faq4Lvc5SHgbk0 ee0BrBftU1Z6r3k8zlNxUohlRkJoxTE+CWYGmqNEbHcHSfiXaOYk8GTrdIued2gl4KYx 0klXMswG3MuOAtEgY60q1l6KjHnBGoU+6TWf7NKnpHQJ71gDySPaRfFTkRMurY8uP0ZL PBcg06MNGB4Q+5rN+3DqoP63QYyqNd/XwiozLsVRF8I+Wt3Q3/sVGXBJiB3fTFBmoMU9 puGxL/epmaLkZdUDr6ehD0+fflrrQtwzlLJbYQo5bzBNSZ5ehVcbIwsnjPxhCVd+kWuf A7vw== X-Gm-Message-State: ANhLgQ1X/AVwYFIuma2R7WoAy8N3bcbL/COSvSIk9NH8a4QmJJKZhu/0 jI1GVq5Cf00Z4dLK2MAIeFLAla2psxRMHSzAK5s= X-Google-Smtp-Source: ADFU+vv3jsYzVRw+9YF5EUjXZZIXAj/hM2M3/p13qSDEs9mOIUadpsUwMLXRx+Z6Q4uYeYUeA1aX4uGeJcglsbEfnoU= X-Received: by 2002:a63:112:: with SMTP id 18mr3558879pgb.116.1583504839934; Fri, 06 Mar 2020 06:27:19 -0800 (PST) MIME-Version: 1.0 References: <5174BD94-9ACA-46DD-BCFD-82AC8573BD8E@139.com> <19ab8c17-b9b2-3ea1-a76b-1002c03db570@apache.org> In-Reply-To: From: tison Date: Fri, 6 Mar 2020 22:26:41 +0800 Message-ID: Subject: Re: (DISSCUSS) flink cli need load '--classpath' files To: Aljoscha Krettek Cc: user Content-Type: multipart/alternative; boundary="0000000000007c04e405a030737f" --0000000000007c04e405a030737f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It is because as implementation when we parse command line argument it "stopAtNonOptions" at the arbitrary content user jar. All arguments later will be regarded as args passed to user main. For user serving, when you run `./bin/flink run -h`, it prints Action "run" compiles and runs a program. Syntax: run [OPTIONS] that explicit explains the format. Best, tison. tison =E4=BA=8E2020=E5=B9=B43=E6=9C=886=E6=97=A5=E5= =91=A8=E4=BA=94 =E4=B8=8B=E5=8D=8810:22=E5=86=99=E9=81=93=EF=BC=9A > I think the problem is that --classpath should be before the user jar, > i.e., /opt/flink/job/kafkaDemo19-1.0-SNAPSHOT.jar > > Best, > tison. > > > Aljoscha Krettek =E4=BA=8E2020=E5=B9=B43=E6=9C=886= =E6=97=A5=E5=91=A8=E4=BA=94 =E4=B8=8B=E5=8D=8810:03=E5=86=99=E9=81=93=EF=BC= =9A > >> Hi, >> >> first a preliminary question: does the jar file contain >> com.alibaba.fastjson.JSON? Could you maybe list the contents of the jar >> here? >> >> Best, >> Aljoscha >> >> On 06.03.20 13:25, ouywl wrote: >> > Hi all >> > When I start a flinkcluster in session mode, It include jm/tm. >> And then I >> > submit a job like =E2=80=98bin/flink run =E2=80=94jobmanager =E2=80=9C= ip:8081=E2=80=9D =E2=80=94class path >> a.jar=E2=80=99. Even >> > the a.jar in all jm/tm and =E2=80=98bin/flink=E2=80=99 mechine . It wi= ll throw >> exception =E2=80=9C >> > /opt/flink/bin/flink run --jobmanager ip:8081 --class >> > com.netease.java.TopSpeedWindowing --parallelism 1 --detached >> > /opt/flink/job/kafkaDemo19-1.0-SNAPSHOT.jar --classpath >> > file:///opt/flink/job/fastjson-1.2.66.jar >> > Starting execution of program >> > Executing TopSpeedWindowing example with default input data set. >> > Use --input to specify file input. >> > java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSON >> > at com.netease.java.TopSpeedWindowing.main(TopSpeedWindowing.java:98) >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> > at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:62) >> > at >> > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:43) >> > at java.lang.reflect.Method.invoke(Method.java:498) >> > at >> > >> org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedP= rogram.java:576) >> > at >> > >> org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeFor= Execution(PackagedProgram.java:438) >> > at >> org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:274= ) >> > at >> org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:= 746)=E2=80=9D >> > As I read the code , flink cli have not load the =E2=80=94classspat= h jar, So >> It seems >> > a bug about the flink cli. Are you agree with me? >> > Best, >> > Ouywl >> > >> > --0000000000007c04e405a030737f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It is because as implementation when we parse command line argume= nt it "stopAtNonOptions" at the arbitrary=C2=A0content=C2=A0user = jar. All arguments later will be regarded as args passed to user main.

For= user serving, when you run `./bin/flink run -h`, it prints

Action "= run" compiles and runs a program.

=C2=A0 Syntax: run [OPTIONS] = <jar-file> <arguments>

that explicit explains the format.<= /div>
Best,<= /div>
tison.
<= /div>


tison <wander4096@gmail.com> =E4=BA=8E2020=E5=B9=B43=E6= =9C=886=E6=97=A5=E5=91=A8=E4=BA=94 =E4=B8=8B=E5=8D=8810:22=E5=86=99=E9=81= =93=EF=BC=9A
I think the problem is that --classpath should be before the user ja= r, i.e.,=C2=A0/opt/fl= ink/job/kafkaDemo19-1.0-SNAPSHOT.jar

Best,
t= ison.

Aljoscha Krettek <aljoscha@apache.org> =E4=BA=8E2020=E5=B9=B43=E6=9C=886=E6=97=A5= =E5=91=A8=E4=BA=94 =E4=B8=8B=E5=8D=8810:03=E5=86=99=E9=81=93=EF=BC=9A
Hi,

first a preliminary question: does the jar file contain
com.alibaba.fastjson.JSON? Could you maybe list the contents of the jar here?

Best,
Aljoscha

On 06.03.20 13:25, ouywl wrote:
> Hi all
>=C2=A0 =C2=A0 =C2=A0 =C2=A0When I start a flinkcluster in session mode,= It include jm/tm. And then I
> submit a job like =E2=80=98bin/flink run =E2=80=94jobmanager =E2=80=9C= ip:8081=E2=80=9D =E2=80=94class path=C2=A0 a.jar=E2=80=99. Even
> the a.jar in all jm/tm and =E2=80=98bin/flink=E2=80=99 mechine . It wi= ll throw exception =E2=80=9C
> /opt/flink/bin/flink run --jobmanager ip:8081 --class
> com.netease.java.TopSpeedWindowing --parallelism 1 --detached
> /opt/flink/job/kafkaDemo19-1.0-SNAPSHOT.jar --classpath
> file:///opt/flink/job/fastjson-1.2.66.jar
> Starting execution of program
> Executing TopSpeedWindowing example with default input data set.
> Use --input to specify file input.
> java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSON
> at com.netease.java.TopSpeedWindowing.main(TopSpeedWindowing.java:98)<= br> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp= l.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess= orImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.apache.flink.client.program.PackagedProgram.callMainMethod(Package= dProgram.java:576)
> at
> org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeF= orExecution(PackagedProgram.java:438)
> at org.apache.flink.client.program.ClusterClient.run(ClusterClient.jav= a:274)
> at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.= java:746)=E2=80=9D
>=C2=A0 =C2=A0 As I read the code , flink cli have not load the =E2=80= =94classspath jar, So It seems
> a bug about the flink cli. Are you agree with me?
> Best,
> Ouywl
>
--0000000000007c04e405a030737f--