当前位置:   article > 正文

Flink 一个 依赖 引起的错误 JobGraph。_flink1.7.1中jobgraph jobgraph = program.getjobgraph

flink1.7.1中jobgraph jobgraph = program.getjobgraph();报错

错误如下 :

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.flink.optimizer.plantranslate.JobGraphGenerator.addUserArtifactEntries(Ljava/util/Collection;Lorg/apache/flink/runtime/jobgraph/JobGraph;)V
	at org.apache.flink.streaming.api.graph.StreamingJobGraphGenerator.createJobGraph(StreamingJobGraphGenerator.java:183)
	at org.apache.flink.streaming.api.graph.StreamingJobGraphGenerator.createJobGraph(StreamingJobGraphGenerator.java:104)
	at org.apache.flink.streaming.api.graph.StreamGraph.getJobGraph(StreamGraph.java:777)
	at org.apache.flink.streaming.api.graph.StreamGraphTranslator.translateToJobGraph(StreamGraphTranslator.java:52)
	at org.apache.flink.client.FlinkPipelineTranslationUtil.getJobGraph(FlinkPipelineTranslationUtil.java:43)
	at org.apache.flink.client.deployment.executors.LocalExecutor.getJobGraph(LocalExecutor.java:98)
	at org.apache.flink.client.deployment.executors.LocalExecutor.execute(LocalExecutor.java:79)
	at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.executeAsync(StreamExecutionEnvironment.java:1740)
	at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1641)
	at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:74)
	at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1627)
	at com.gongzhugou.realtime.commmon.StreamBaseEnvironment.execute(StreamBaseEnvironment.java:128)
	at com.gongzhugou.realtime.commmon.StreamBaseEnvironment.start(StreamBaseEnvironment.java:38)
	at com.gongzhugou.realtime.flink.product.ProductSaleVolume.main(ProductSaleVolume.java:43)ava
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

在这里插入图片描述

原因

Flink 中引入下面的依赖。 删除掉就好了。

  <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-clients_${scala.binary.version}</artifactId>
      <version>${flink.version}</version>
  </dependency>
  • 1
  • 2
  • 3
  • 4
  • 5

原因是 因为这个包在其他的里面已经存在, 比如下面的这个包中就存在。

<groupId>org.apache.flink</groupId>
	<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
  • 1
  • 2
  • 3

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/528442
推荐阅读
相关标签
  

闽ICP备14008679号