我正在Google AppEngine上运行一个应用程序,它会生成数据流模板并启动它们。在其中一个管道中,在DoFn内部,该进程生成另一个管道并在其继续工作之前等待它完成。直到几天前,这不是问题。但是现在,当调用pipeline.run()时,我得到一个NoSuchMethodError。
stacktrace:
java.lang.NoSuchMethodError:org.apache.beam.sdk.common.runner.v1.RunnerApi $ FunctionSpec $ Builder.setPayload(Lcom / google / protobuf / ByteString;)Lorg / apache / beam / sdk / common /亚军/ V1 / RunnerApi $ FunctionSpec $生成器; 在org.apache.beam.runners.dataflow.repackaged.org.apache.beam.runners.core.construction.WindowingStrategyTranslation.toProto(WindowingStrategyTranslation.java:224) 在org.apache.beam.runners.dataflow.repackaged.org.apache.beam.runners.core.construction.WindowingStrategyTranslation.toProto(WindowingStrategyTranslation.java:299) 在org.apache.beam.runners.dataflow.repackaged.org.apache.beam.runners.core.construction.WindowingStrategyTranslation.toProto(WindowingStrategyTranslation.java:285) 在org.apache.beam.runners.dataflow.DataflowPipelineTranslator.serializeWindowingStrategy(DataflowPipelineTranslator.java:129) 在org.apache.beam.runners.dataflow.DataflowPipelineTranslator.access $ 1500(DataflowPipelineTranslator.java:114) 在org.apache.beam.runners.dataflow.DataflowPipelineTranslator $ 5.groupByKeyHelper(DataflowPipelineTranslator.java:806) 在org.apache.beam.runners.dataflow.DataflowPipelineTranslator $ 5.translate(DataflowPipelineTranslator.java:784) 在org.apache.beam.runners.dataflow.DataflowPipelineTranslator $ 5.translate(DataflowPipelineTranslator.java:781) 在org.apache.beam.runners.dataflow.DataflowPipelineTranslator $ Translator.visitPrimitiveTransform(DataflowPipelineTranslator.java:442) at org.apache.beam.sdk.runners.TransformHierarchy $ Node.visit(TransformHierarchy.java:663) at org.apache.beam.sdk.runners.TransformHierarchy $ Node.visit(TransformHierarchy.java:655) at org.apache.beam.sdk.runners.TransformHierarchy $ Node.visit(TransformHierarchy.java:655) at org.apache.beam.sdk.runners.TransformHierarchy $ Node.visit(TransformHierarchy.java:655) at org.apache.beam.sdk.runners.TransformHierarchy $ Node.visit(TransformHierarchy.java:655) at org.apache.beam.sdk.runners.TransformHierarchy $ Node.visit(TransformHierarchy.java:655) at org.apache.beam.sdk.runners.TransformHierarchy $ Node.access $ 600(TransformHierarchy.java:311) 在org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:245) 在org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:446) 在org.apache.beam.runners.dataflow.DataflowPipelineTranslator $ Translator.translate(DataflowPipelineTranslator.java:386) 在org.apache.beam.runners.dataflow.DataflowPipelineTranslator.translate(DataflowPipelineTranslator.java:173) 在org.apache.beam.runners.dataflow.DataflowRunner.run(DataflowRunner.java:537) 在org.apache.beam.runners.dataflow.DataflowRunner.run(DataflowRunner.java:170) 在org.apache.beam.sdk.Pipeline.run(Pipeline.java:303) 在org.apache.beam.sdk.Pipeline.run(Pipeline.java:289) 在com.mycompany.projectsign.dataflow.dofn.downloads.something.RunDownloadPipeline.processElement(RunDownloadPipeline.java:150)
我的代码的引用行是pipeline.run()
当我查看Eclipse中的maven-dependencies时,项目中会添加正确的依赖项(和版本),并且RunnerApi.FunctionSpec.Builder.setPayload(com.google.protobuf.ByteString)方法也存在。我继续使用dependencyManagement强制执行版本:
<dependencyManagement>
<dependencies>
....
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-common-runner-api</artifactId>
<version>2.2.0</version>
</dependency>
.....
</dependencies>
</dependencyManagement>
在AppEngine中运行或从localhost创建管道(直接在Google Dataflow上运行)时,可以毫无问题地创建和启动模板,但在DoFn中运行创建的管道会引发相同的错误。
但是,当我直接在我的计算机上运行Pipeline作为本地管道(使用DirectRunner)时,管道运行没有问题,并在GoogleDataflow上创建其他管道。
我将beam-version更新为2.2.0。
如果某位Google员工正在阅读此内容,这是失败的JobIds之一:2017-12-11_07_01_17-3122752092943950314
NoSuchMethodError可能是什么原因?它可能是一个相互冲突的依赖还是其他什么?
非常感谢任何帮助: - )