Scala 无法实例化执行器。确保planner模块位于类路径上
对于scala项目,我使用StreamTableEnvironment,在IntelliJ中运行代码时,一切正常。然而,当我尝试将我的项目导出到jar时(我使用sbt assembly创建了一个胖jar),找不到合适的表工厂。我已经查看了jar内部,并包含了它需要的类。这里是完整的stacktrace:Scala 无法实例化执行器。确保planner模块位于类路径上,scala,apache-flink,Scala,Apache Flink,对于scala项目,我使用StreamTableEnvironment,在IntelliJ中运行代码时,一切正常。然而,当我尝试将我的项目导出到jar时(我使用sbt assembly创建了一个胖jar),找不到合适的表工厂。我已经查看了jar内部,并包含了它需要的类。这里是完整的stacktrace: Exception in thread "main" org.apache.flink.table.api.TableException: Could not instantiate the e
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.scala.internal.StreamTableEnvironmentImpl$.lookupExecutor(StreamTableEnvironmentImpl.scala:328)
at org.apache.flink.table.api.scala.internal.StreamTableEnvironmentImpl$.create(StreamTableEnvironmentImpl.scala:284)
at org.apache.flink.table.api.scala.StreamTableEnvironment$.create(StreamTableEnvironment.scala:366)
at org.tudelft.plugins.SQLService$.setupEnv(SQLService.scala:40)
at org.tudelft.plugins.SQLStage.main(SQLStage.scala:19)
at org.codefeedr.stages.OutputStage.transform(OutputStage.scala:45)
at org.codefeedr.pipeline.Pipeline.$anonfun$startMock$1(Pipeline.scala:240)
at org.codefeedr.pipeline.Pipeline.$anonfun$startMock$1$adapted(Pipeline.scala:238)
at scala.collection.Iterator.foreach(Iterator.scala:941)
at scala.collection.Iterator.foreach$(Iterator.scala:941)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at org.codefeedr.pipeline.Pipeline.startMock(Pipeline.scala:238)
at org.tudelft.Main$.main(Main.scala:34)
at org.tudelft.Main.main(Main.scala)
Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for 'org.apache.flink.table.delegation.ExecutorFactory' in
the classpath.
Reason: No factory implements 'org.apache.flink.table.delegation.ExecutorFactory'.
The following properties are requested:
class-name=org.apache.flink.table.executor.StreamExecutorFactory
streaming-mode=true
The following factories have been considered:
at org.apache.flink.table.factories.TableFactoryService.filterByFactoryClass(TableFactoryService.java:243)
at org.apache.flink.table.factories.TableFactoryService.filter(TableFactoryService.java:186)
at org.apache.flink.table.factories.TableFactoryService.findAllInternal(TableFactoryService.java:172)
at org.apache.flink.table.factories.TableFactoryService.findAll(TableFactoryService.java:126)
at org.apache.flink.table.factories.ComponentFactoryService.find(ComponentFactoryService.java:48)
at org.apache.flink.table.api.scala.internal.StreamTableEnvironmentImpl$.lookupExecutor(StreamTableEnvironmentImpl.scala:312)
... 16 more```
回答可能有点晚,但我也遇到了同样的问题,解决方案是添加blink planner依赖项(原始答案:)您能为您的项目提供依赖项吗??