I have created an application with Apache FLink 1.0.3 using Scala 2.11.7 and I want to test it locally (a single jvm). So I did the following as stated in the website:
./bin/start-local.sh
tail log/flink-*-jobmanager-*.log
And it starts just fine, I can see the web interface at localhost:8081. Then, I tried to submit my application, but I get either an exception or a weird message. For example when I type either of the following commands:
./bin/flink run ./myApp.jar
./bin/flink run ./myApp.jar -c MyMain
./bin/flink run ./myApp.jar -c myMain.class
./bin/flink run ./myApp.jar -c myMain.scala
./bin/flink run ./myApp.jar -c my.package.myMain
./bin/flink run ./myApp.jar -c my.package.myMain.class
./bin/flink run ./myApp.jar -c my.package.myMain.scala
I get the following exception:
------------------------------------------------------------
The program finished with the following exception:
org.apache.flink.client.program.ProgramInvocationException: Neither a 'Main-Class', nor a 'program-class' entry was found in the jar file.
at org.apache.flink.client.program.PackagedProgram.getEntryPointClassNameFromJar(PackagedProgram.java:571)
at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:188)
at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:126)
at org.apache.flink.client.CliFrontend.buildProgram(CliFrontend.java:922)
at org.apache.flink.client.CliFrontend.run(CliFrontend.java:301)
at org.apache.flink.client.CliFrontend.parseParameters(CliFrontend.java:1192)
at org.apache.flink.client.CliFrontend.main(CliFrontend.java:1243)
And when I type either of the following commands:
./bin/flink run ./ -c myMain myApp.jar
./bin/flink run ./ -c myMain.class myApp.jar
./bin/flink run ./ -c myMain.scala myApp.jar
./bin/flink run ./ -c my.package.myMain myApp.jar
./bin/flink run ./ -c my.package.myMain.class myApp.jar
./bin/flink run ./ -c my.package.myMain.scala myApp.jar
I get the following error:
JAR file is not a file: .
Use the help option (-h or --help) to get help on the command.
The above commands do not work either with -c or --class. I use IntelliJ and I compiled the application using the Build Module from Dependencies option. What am I doing wrong?
myApp.jardoes not contain theMyMainclass? Could you maybe runjar -tf myApp.jarand verify that it contains the above-mentioned class and that this class contains amainmethod?jarcommand cannot list the contents properly. This could indicate that you jar file is somehow corrupted.