报错信息
Exception in thread “main” 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:534)
at org.apache.flink.table.api.internal.TableEnvironmentImpl.create(TableEnvironmentImpl.java:278)
at org.apache.flink.table.api.TableEnvironment.create(TableEnvironment.java:93)
at com.dadao.flinktodoris.GoodsDataPipelineLocal.main(GoodsDataPipelineLocal.java:12)
- 提交jar包到flink报错 修改pom插件
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.1.1</version> <configuration> <createDependencyReducedPom>false</createDependencyReducedPom> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <filters> <filter> <!-- Do not copy the signatures in the META-INF folder. Otherwise, this might cause SecurityExceptions when using the JAR. --> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> <!-- 合并多个connetor 的META-INF.services 文件--> <!-- <transformers>--> <!-- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">--> <!-- <resource>reference.conf</resource>--> <!-- </transformer>--> <!-- <!– The service transformer is needed to merge META-INF/services files –>--> <!-- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>--> <!-- <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">--> <!-- <projectName>Apache Flink</projectName>--> <!-- <encoding>UTF-8</encoding>--> <!-- </transformer>--> <!-- </transformers>--> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.dadao.flinktodoris.GoodsDataPipelineLocal</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>8</source> <target>8</target> </configuration> </plugin> </plugins> </build>
- 运行报错 增加相关依赖
<!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-java --> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-table-api-java</artifactId> <version>1.16.3</version> </dependency>