Flink踩坑实录

No ExecutorFactory found to execute the application.

Exception in thread "main" java.lang.IllegalStateException: No ExecutorFactory found to execute the application.
	at org.apache.flink.core.execution.DefaultExecutorServiceLoader.getExecutorFactory(DefaultExecutorServiceLoader.java:88)
	at org.apache.flink.api.java.ExecutionEnvironment.executeAsync(ExecutionEnvironment.java:1043)
	at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:958)
	at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:942)
	at org.apache.flink.api.java.DataSet.collect(DataSet.java:417)
	at org.apache.flink.api.java.DataSet.print(DataSet.java:1748)

版本问题。笔者用的是1.12版本,需要flink-clients客户端依赖。

 <dependency>
     <groupId>org.apache.flink</groupId>
     <artifactId>flink-clients_2.12</artifactId>
     <version>1.12.1</version>
 </dependency>

No new data sinks have been defined since the last execution.

Exception in thread “main” java.lang.RuntimeException: No new data sinks have been defined since the last execution. The last execution refers to the latest call to ‘execute()’, ‘count()’, ‘collect()’, or ‘print()’.
at org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:1165)
解决方法:Flink批处理任务注释掉env.execute()即可

java.lang.NoClassDefFoundError: org/apache/flink/api/common/functions/FlatMapFunction

错误: 无法初始化主类 com.awecoder.flink.basic.StreamWordCount
原因: java.lang.NoClassDefFoundError: org/apache/flink/api/common/functions/FlatMapFunction

去掉依赖中provided。

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by org.apache.flink.api.java.ClosureCleaner (file:/D:/Program%20Files/apache-maven-3.5.4/repo/org/apache/flink/flink-core/1.12.7/flink-core-1.12.7.jar) to field java.lang.String.value
WARNING: Please consider reporting this to the maintainers of org.apache.flink.api.java.ClosureCleaner
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

可能是JDK版本过高,用了11,换成8即可。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值