Exception in thread "main" java.lang.NoSuchMethodError: org.apache.flink.api.java.Utils.resolveFactory(Ljava/lang/ThreadLocal;Ljava/lang/Object;)Ljava/util/Optional;

刘超 23天前 ⋅ 141 阅读   编辑

一、描述

  eclipse flink1.10.1有如下错误

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.flink.api.java.Utils.resolveFactory(Ljava/lang/ThreadLocal;Ljava/lang/Object;)Ljava/util/Optional;
 at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.getExecutionEnvironment(StreamExecutionEnvironment.java:1857)
 at net.itdiandi.flink.ProducerTestData.main(ProducerTestData.java:12)

二、分析

  1、增加jvm参数:-verbose:class,打印加载日志,发现加载是flink-java-1.5.0的,在pom.xml中,将flink-java依赖改为1.10.1即可

三、解决方法

  在pom.xml中,将flink-java依赖改为1.10.1即可


注意:本文归作者所有,未经作者允许,不得转载

全部评论: 0

    我有话说: