Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NoSuchMethod exception in Flink when using dataset with custom object array

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

like image 968
il.bert Avatar asked Sep 18 '25 15:09

il.bert


1 Answers

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.

like image 129
Fabian Hueske Avatar answered Sep 20 '25 08:09

Fabian Hueske