You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Adrian Bartnik <ba...@campus.tu-berlin.de> on 2016/05/06 12:47:43 UTC
NoSuchMethodError when using the Flink Gelly library with Scala
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
Re: NoSuchMethodError when using the Flink Gelly library with Scala
Posted by Ufuk Celebi <uc...@apache.org>.
On Fri, May 6, 2016 at 2:47 PM, Adrian Bartnik
<ba...@campus.tu-berlin.de> 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?