Re: Flink Stateful Function: The program's entry point class not found in the jar file

Posted by flint-stone on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Flink-Stateful-Function-The-program-s-entry-point-class-not-found-in-the-jar-file-tp40269p40455.html

Thanks Igal the application runs perfectly now!

Le

On Mon, Jan 4, 2021 at 9:13 AM Igal Shilman <[hidden email]> wrote:
Hi Le,

Looking at your pom.xml, you are pointing to the wrong main method here:

You need to change it to your Example class, this should work.


On Tue, Dec 29, 2020 at 5:06 AM Le Xu <[hidden email]> wrote:
Hi Igal:

Thanks for pointing that out. I was able to add the dependency in and submit the job. For statefun-greeter example [1] I was able to submit the job to the cluster . But when I try out the statefun-data-stream example [2] I got the complaints saying that "There are no ingress defined" (I'm adding the full trace to the end of the email). (I'm also adding my pom to [3] and source file to [4].) From the example it appears the job uses the Datastream as ingress [5] so ideally the job should be able to receive events as trigger periodically (the job works fine with local environment). I also came across this issue [6] but I don't think it helps solving my problem. By any chance you'd know what's going on?



Error Trace:
 The program finished with the following exception:

org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: There are no ingress defined.
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:302)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:198)
at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:149)
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:699)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:232)
at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:916)
at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:992)
at org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:992)
Caused by: java.lang.IllegalStateException: There are no ingress defined.
at org.apache.flink.statefun.flink.core.StatefulFunctionsUniverseValidator.validate(StatefulFunctionsUniverseValidator.java:25)
at org.apache.flink.statefun.flink.core.StatefulFunctionsJob.main(StatefulFunctionsJob.java:76)
at org.apache.flink.statefun.flink.core.StatefulFunctionsJob.main(StatefulFunctionsJob.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:288)
... 8 more


Thanks for the help!

Le


On Mon, Dec 28, 2020 at 6:24 AM Igal Shilman <[hidden email]> wrote:
Hi Le,
Indeed you have added the dependency correctly. But the resulting artifact doesn't contain the dependencies. You need to create a jar with dependencies ( via [1] or [2])
Take a look at [3] for a usage example of the maven shade plugin.

I hope this helps,
Igal.


On Sat, Dec 26, 2020 at 11:52 PM Le Xu <[hidden email]> wrote:
Thanks Igal! I might be missing something here. I did place statefun-flink-distribution as part of my dependency in the pom (see line 46 at [1]).  Is there a correct way to include the jar? I'm having the same problem across many examples I'm running.

Thanks!

Le

On Sat, Dec 26, 2020 at 2:23 PM Igal Shilman <[hidden email]> wrote:
Hello :-)

It seems like in your attached pom you are not bundling the dependencies. Check out the docs here [1].



On Wed, Dec 23, 2020 at 3:07 AM Le Xu <[hidden email]> wrote:
Hello!
I'm trying to deploy a Flink stateful function as a flink jar and I followed the instruction here. However I'm getting the error saying that the program entry point class was not found in the jar even after I added the dependency in my pom.

Running:

bin/flink run -c org.apache.flink.statefun.flink.core.StatefulFunctionsJob flink-statefun/statefun-examples/statefun-greeter-example/target/statefun-greeter-example-2.3-SNAPSHOT.jar

Producing the following error:

org.apache.flink.client.program.ProgramInvocationException: The program's entry point class 'org.apache.flink.statefun.flink.core.StatefulFunctionsJob' was not found in the jar file. at org.apache.flink.client.program.PackagedProgram.loadMainClass(PackagedProgram.java:389) at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:139) at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:61) at org.apache.flink.client.program.PackagedProgram$Builder.build(PackagedProgram.java:557) at org.apache.flink.client.cli.CliFrontend.buildProgram(CliFrontend.java:726) at org.apache.flink.client.cli.CliFrontend.getPackagedProgram(CliFrontend.java:242) at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:223) at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:916) at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:992) at org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30) at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:992) Caused by: java.lang.ClassNotFoundException: org.apache.flink.statefun.flink.core.StatefulFunctionsJob at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at org.apache.flink.util.FlinkUserCodeClassLoader.loadClassWithoutExceptionHandling(FlinkUserCodeClassLoader.java:61) at org.apache.flink.util.ChildFirstClassLoader.loadClassWithoutExceptionHandling(ChildFirstClassLoader.java:65) at org.apache.flink.util.FlinkUserCodeClassLoader.loadClass(FlinkUserCodeClassLoader.java:48) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.flink.client.program.PackagedProgram.loadMainClass(PackagedProgram.java:387) ... 10 more
Here is my modified pom.xml. The original version of the pom file can be found here here. It seems that adding the extra dependency of statefun-flink-distribution has no effect. Any suggestions?

Thanks!

Le