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?


[1]
https://github.com/apache/flink-statefun/tree/master/statefun-examples/statefun-greeter-example
[2]
https://github.com/flint-stone/flink-statefun/blob/3aba506242300d69e95ef339afeac8e561dc7a2d/statefun-examples/statefun-flink-datastream-example/src/main/java/org/apache/flink/statefun/examples/datastream/Example.java#L82
[3]
https://github.com/flint-stone/flink-statefun/blob/lx-base/statefun-examples/statefun-flink-datastream-example/pom.xml
[4]
https://github.com/flint-stone/flink-statefun/blob/lx-base/statefun-examples/statefun-flink-datastream-example/src/main/java/org/apache/flink/statefun/examples/datastream/Example.java
[5]
https://github.com/flint-stone/flink-statefun/blob/3aba506242300d69e95ef339afeac8e561dc7a2d/statefun-examples/statefun-flink-datastream-example/src/main/java/org/apache/flink/statefun/examples/datastream/Example.java#L82
[6]
https://stackoverflow.com/questions/61578082/flink-statefun-co-located-functions-communication

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 <i...@ververica.com> 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.
>
> [1] https://maven.apache.org/plugins/maven-assembly-plugin/usage.html
> [2] https://maven.apache.org/plugins/maven-shade-plugin/
> [3]
> https://github.com/apache/flink-statefun/blob/master/statefun-flink/statefun-flink-distribution/pom.xml#L126,L199
>
> On Sat, Dec 26, 2020 at 11:52 PM Le Xu <sharonx...@gmail.com> 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.
>>
>> [1]
>> https://gist.github.com/flint-stone/059f00832d8b99af433a446771f4f740#file-pom-xml-L64
>>
>> Thanks!
>>
>> Le
>>
>> On Sat, Dec 26, 2020 at 2:23 PM Igal Shilman <i...@ververica.com> wrote:
>>
>>> Hello :-)
>>>
>>> It seems like in your attached pom you are not bundling the
>>> dependencies. Check out the docs here [1].
>>>
>>>
>>> [1]
>>> https://ci.apache.org/projects/flink/flink-statefun-docs-release-2.2/deployment-and-operations/packaging.html#flink-jar
>>>
>>>
>>> On Wed, Dec 23, 2020 at 3:07 AM Le Xu <sharonx...@gmail.com> wrote:
>>>
>>>> Hello!
>>>> I'm trying to deploy a Flink stateful function as a flink jar and I
>>>> followed the instruction here
>>>> <https://github.com/apache/flink-statefun>. 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 
>>>> <https://gist.github.com/flint-stone/059f00832d8b99af433a446771f4f740>. 
>>>> The original version of the pom file can be found here here 
>>>> <https://github.com/apache/flink-statefun/blob/master/statefun-examples/statefun-greeter-example/pom.xml>.
>>>>  It seems that adding the extra dependency of statefun-flink-distribution 
>>>> has no effect. Any suggestions?
>>>>
>>>> Thanks!
>>>>
>>>> Le
>>>>
>>>>
>>>>
>>>>

Reply via email to