Windows中的Apache Beam WordCount运行错误 [英] Apache beam WordCount running error in windows
问题描述
尝试运行Apache Beam(2.0版)的 WordCount 示例. 0)首先运行
Trying to run WordCount example of Apache Beam (version 2.0.0) by first running
$ mvn archetype:generate \
-DarchetypeGroupId=org.apache.beam \
-DarchetypeArtifactId=beam-sdks-java-maven-archetypes-examples \
-DarchetypeVersion=2.0.0 \
-DgroupId=org.example \
-DartifactId=word-count-beam \
-Dversion="0.1" \
-Dpackage=org.apache.beam.examples \
-DinteractiveMode=false
然后运行
$ mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount -Dexec.args="--inputFile=pom.xml --output=counts" -Pdirect-runner
并出现以下错误
[错误]无法在项目字计数梁上执行目标org.codehaus.mojo:exec-maven-plugin:1.4.0:java(default-cli):执行该目标时发生异常 Java类. null:InvocationTargetException:java.lang.IllegalStateException:U 无法找到d的注册商-> [帮助1]
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project word-count-beam: An exception occured while executing the Java class. null: InvocationTargetException: java.lang.IllegalStateException: U nable to find registrar for d -> [Help 1]
但是,如果我运行的是2017年3月下载并构建的同一项目(Beam v0.6.0),则一切正常.我只是想知道Beam发行版的哪些更新会导致此错误.
However, if I run the same project downloaded and built in Mar 2017 (Beam v0.6.0), everything works fine. I just wonder what update of the Beam release causes this error.
推荐答案
发生此错误是由于 TextIO#from("path_to_file")方法不支持Windows文件系统路径. 例如,以下代码引发 IllegalStateException :
This error happens due to TextIO#from("path_to_file") method doesn't support Windows file system paths. For example the following code throws IllegalStateException:
TextIO.read().from("d:\\file.txt") // also "file:\\D:\\file.txt" throw exc
线程主"中的异常 org.apache.beam.sdk.Pipeline $ PipelineExecutionException: java.lang.IllegalStateException:无法找到d的注册商
Exception in thread "main" org.apache.beam.sdk.Pipeline$PipelineExecutionException: java.lang.IllegalStateException: Unable to find registrar for d
我希望Apache Beam团队会在不久的将来对其进行修复...
I hope that Apache Beam team will fix it in near future...
这篇关于Windows中的Apache Beam WordCount运行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!