Java.Lang.Nosuchmethoderror in Flink

java.lang.NoSuchMethodError in Flink

One possible cause for error "java.lang.NoSuchMethodError" is when we use different version of flink then what we have installed on our system. For me, I have Flink 1.3.2 and the version I was using was 1.1.1 . So I updated my pom file to have same version.

Flink: java.lang.NoSuchMethodError: AvroSchemaConverter

The problem was with dependency. The trick was to either remove Avro 1.11.0 from Flink, or remove Avro 1.7.7 from Hive. I ended up removing Avro 1.11.0 and replacing it with a different Avro version:

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-avro-confluent-registry</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-avro</artifactId>
<version>1.13.2</version>
<exclusions>
<exclusion>
<groupId>org.apache.avro</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.8.2-cdh6.1.1</version>
</dependency>

Another way that will also work is to use hive-exec::core and hive-metastore as dependencies.

Flink CEP: java.lang.NoSuchMethodError

A NoSuchMethodError indicates a version conflict.

You should verify that you compiled your Flink job with the same Flink version as your cluster is running.

flink scala streaming error java.lang.NoSuchMethodError: org.apache.flink.util.PropertiesUtil.getBoolean(Ljava/util/Properties;Ljava/lang/String;Z)Z

This problem was caused by running a Flink 1.10.0 client on a Flink 1.2.0 cluster. Upgrading the cluster to 1.10.0 solved the issue.

Flink Scala Job Runtime Error : java.lang.NoSuchMethodError

If you're using EMR's Flink support, then most Flink libraries should be flagged as "provided" so that they're not in your jar, as they're on the classpath from the Flink installation that EMR is providing. You'll still need to explicitly include anything that's not provided by EMR (e.g. flink-connector-kafka).



Related Topics



Leave a reply



Submit