NoSuchMethodError when using the Flink Gelly library with Scala

Posted by Adrian Bartnik on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/NoSuchMethodError-when-using-the-Flink-Gelly-library-with-Scala-tp6738.html

Hi,

I am trying to run the code examples from the Gelly documentation, in
particular this code:

import org.apache.flink.api.scala._
import org.apache.flink.graph.generator.GridGraph

object SampleObject {
   def main(args: Array[String]) {

     val env = ExecutionEnvironment.getExecutionEnvironment

     val graph = new GridGraph(env.getJavaEnv).addDimension(2,
true).addDimension(4, true).generate()

    ...
   }
}

I created the project using the maven quickstart script, and compiling
works fine,
but when I want to execute the jar on my local machine, the following
error occurs:
java.lang.NoSuchMethodError:
org.apache.flink.api.scala.ExecutionEnvironment.getJavaEnv()Lorg/apache/flink/api/java/ExecutionEnvironment;

My pom.xml looks like this:

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <flink.version>1.1-SNAPSHOT</flink.version>
</properties>

<dependencies>
    <dependency>
       <groupId>org.apache.flink</groupId>
       <artifactId>flink-clients_2.11</artifactId>
       <version>${flink.version}</version>
    </dependency>
    <dependency>
       <groupId>org.apache.flink</groupId>
       <artifactId>flink-scala_2.11</artifactId>
       <version>${flink.version}</version>
    </dependency>
    <dependency>
       <groupId>org.apache.flink</groupId>
       <artifactId>flink-gelly-scala_2.11</artifactId>
       <version>${flink.version}</version>
    </dependency>
</dependencies>

Scala -version prints: Scala code runner version 2.11.6 -- Copyright
2002-2013, LAMP/EPFL

Thanks,
Adrian