NoSuchMethodError when using the Flink Gelly library with Scala

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NoSuchMethodError when using the Flink Gelly library with Scala

Adrian Bartnik
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
Reply | Threaded
Open this post in threaded view
|

Re: NoSuchMethodError when using the Flink Gelly library with Scala

Ufuk Celebi
On Fri, May 6, 2016 at 2:47 PM, Adrian Bartnik
<[hidden email]> wrote:
>  <dependency>
>       <groupId>org.apache.flink</groupId>
>       <artifactId>flink-scala_2.11</artifactId>
>       <version>${flink.version}</version>
>    </dependency>

This should be flink-java. Did you manually create this or do you get
it from the quickstart scripts?