flink cdc使用flink sql方式运行一直报Make sure a planner module is on the classpath
flink cdc使用flink sql方式运行一直报Make sure a planner module is on the classpath
引入jar包信息:
flink-connector-oracle-cdc:3.2.1
flink:1.20.0
flink-table-runtime:1.20.0
flink-streaming-java:1.20.0
flink-clients:1.20.0
Exception in thread "main" org.apache.flink.table.api.TableException: Could not instantiate the executor. Make sure a planner module is on the classpath
at org.apache.flink.table.api.bridge.internal.AbstractStreamTableEnvironmentImpl.lookupExecutor(AbstractStreamTableEnvironmentImpl.java:109)
at org.apache.flink.table.api.bridge.java.internal.StreamTableEnvironmentImpl.create(StreamTableEnvironmentImpl.java:110)
at org.apache.flink.table.api.bridge.java.StreamTableEnvironment.create(StreamTableEnvironment.java:122)
at org.apache.flink.table.api.bridge.java.StreamTableEnvironment.create(StreamTableEnvironment.java:94)
at com.anytxn.cdc.finksql.CardholderSqlCdc.main(CardholderSqlCdc.java:23)
Caused by: org.apache.flink.table.api.ValidationException: Could not find any factories that implement 'org.apache.flink.table.delegation.ExecutorFactory' in the classpath.
at org.apache.flink.table.factories.FactoryUtil.discoverFactory(FactoryUtil.java:612)
at org.apache.flink.table.api.bridge.internal.AbstractStreamTableEnvironmentImpl.lookupExecutor(AbstractStreamTableEnvironmentImpl.java:106)
... 4 more
Flink 发行版默认包含执行 Flink SQL 任务的必要 JAR 文件(位于 /lib
目录),主要有:
flink-table-api-java-uber-1.20.0.jar
→ 包含所有的 Java API;flink-table-runtime-1.20.0.jar
→ 包含 Table 运行时;flink-table-planner-loader-1.20.0.jar
→ 包含查询计划器。
以前,这些 JAR 都打包进了flink-table.jar
,自从 Flink 1.15 开始,已将其划分成三个 JAR,以允许用户使用flink-table-planner-loader-1.20.0.jar
充当flink-table-planner_2.12-1.20.0.jar
。
根据官网提示,缺少了flink-table-planner-loader、flink-table-api-java-uber
加上之后,再运行,还是报一样的错。
最后,再引入这个包:flink-table-api-java
运行就不报错了。
参考:
https://zhuanlan.zhihu.com/p/558950840
高级配置 | Apache Flink