4

I have a problem with Flink

java.lang.NoSuchMethodError: org.apache.flink.api.java.typeutils.ObjectArrayTypeInfo.getInfoFor(Lorg/apache/flink/api/common/typeinfo/TypeInformation;)Lorg/apache/flink/api/java/typeutils/ObjectArrayTypeInfo;
    at LowLevel.FlinkImplementation.FlinkImplementation$$anon$6.<init>(FlinkImplementation.scala:28)
    at LowLevel.FlinkImplementation.FlinkImplementation.<init>(FlinkImplementation.scala:28)
    at IRLogic.GmqlServer.<init>(GmqlServer.scala:15)
    at it.polimi.App$.main(App.scala:20)
    at it.polimi.App.main(App.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ...

the line with the problem is this one

implicit val regionTypeInformation = 
         api.scala.createTypeInformation[FlinkDataTypes.FlinkRegionType]

in the FlinkRegionType I have an Array of custom object

I developed the app with the maven plugin in the IDE and everything is working good, but when I move to the version I downloaded from the website I get the error above

I am using Flink 0.9

I was thinking that some library may be missing but I am using maven for handling everything. Moreover running through the code of ObjectArrayTypeInfo.java it doesn't seem to be the problem

kdopen
  • 8,032
  • 7
  • 44
  • 52
il.bert
  • 232
  • 1
  • 3
  • 11
  • Are you sure that you are using the same Flink versions. The quickstart Maven archetypes are configured for Flink 0.8.1. Can you check the pom.xml file if version is correctly set to 0.9 (milestone-1 or SNAPSHOT)? – Fabian Hueske May 08 '15 at 10:19
  • in the pom.xml i have 0.9-SNAPSHOT, in the webclient 0.9.0-milestone-1 – il.bert May 08 '15 at 10:52
  • Have you tried to set the pom.xml to 0.9.0-milestone-1 and rebuild the program JAR file? – Fabian Hueske May 08 '15 at 10:59
  • ok using the milestone-1 in maven it showed me some different errors, but after solving them everything works correctly, thanks. if you post an answer i will mark it as correct – il.bert May 08 '15 at 11:52
  • Possible duplicate of [java.lang.NoSuchMethodError in Flink](https://stackoverflow.com/questions/46920543/java-lang-nosuchmethoderror-in-flink) – Yaroslav Oct 25 '17 at 12:45

1 Answers1

3

A NoSuchMethodError commonly indicates a version mismatch between the libraries a Flink program was compiled with and the system the program is executed on. Especially if the same code works in an IDE setup where compile and execution libraries are the same.

In such case, you should check the version of the Flink dependencies, for example in the Maven POM file.

Fabian Hueske
  • 18,707
  • 2
  • 44
  • 49