Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flink: Jar file contains no main class

When trying to execute a Flink job, I have this error message :

org.apache.flink.client.program.ProgramInvocationException: Neither a 'Main-Class', nor a 'program-class' entry was found in the jar file.

Although in my pom, I declare the main class as:

     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Main-Class>com.package.Main</Main-Class>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

Can someone show me what I have missed ?

Thank you

like image 766
Xitrum Avatar asked Dec 23 '16 09:12

Xitrum


2 Answers

It seems like an error on the mvn package. Have you tried the following command?

./bin/flink run -c your.main.class flinkprogram.jar 
like image 99
nach0 Avatar answered Nov 06 '22 06:11

nach0


Try to declare the main class with the following entry in pom.xml:

 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-jar-plugin</artifactId>
   <version>2.5</version>
   <configuration>
     <archive>
       <manifest>
         <mainClass>com.package.Main</mainClass>
       </manifest>
     </archive>
   </configuration>
 </plugin>
like image 41
Alex Chermenin Avatar answered Nov 06 '22 06:11

Alex Chermenin