gpt4 book ai didi

java - 尝试使用 DataflowRunner 时出现 ClassNotFound 异常

转载 作者:搜寻专家 更新时间:2023-10-31 20:00:12 24 4
gpt4 key购买 nike

我正在尝试使用 Apache Beam 0.6.0 在 GCP 上启动数据流作业。我正在使用 shade 插件编译一个 uber jar,因为我无法使用“mvn:execjava”启 Action 业。我包括这个依赖项:

<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
<version>0.6.0-SNAPSHOT</version>
</dependency>

我收到以下异常:

Exception in thread "main" java.lang.IllegalArgumentException: Unknown 'runner' specified 'DataflowRunner', supported pipeline runners [DirectRunner]
at org.apache.beam.sdk.options.PipelineOptionsFactory.parseObjects(PipelineOptionsFactory.java:1609)
at org.apache.beam.sdk.options.PipelineOptionsFactory.access$400(PipelineOptionsFactory.java:104)
at org.apache.beam.sdk.options.PipelineOptionsFactory$Builder.as(PipelineOptionsFactory.java:289)
at com.disney.dtss.desa.tools.SpannerSinkTest.main(SpannerSinkTest.java:116)
Caused by: java.lang.ClassNotFoundException: DataflowRunner
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.beam.sdk.options.PipelineOptionsFactory.parseObjects(PipelineOptionsFactory.java:1595)

我还漏掉了什么吗?

最佳答案

尝试

mvn compile exec:java -Dexec.mainClass=Yourmain Class -Pdataflow-runner

*在最后添加-Pdataflow-runner

关于java - 尝试使用 DataflowRunner 时出现 ClassNotFound 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42937284/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com