0

我正在结合使用 spring-data 项目和 hadoop 来运行 map-red 作业。我的应用程序上下文似乎无法解析类路径资源。

    <hdp:job id="myjob" input-path="wordcount/in/" output-path="wordcount/outtttt/"
         mapper="org.apache.hadoop.examples.WordCount.TokenizerMapper"
         reducer="org.apache.hadoop.examples.WordCount.IntSumReducer"
         jar="classpath:hadoop-examples-1.0-SNAPSHOT.jar"
         jar-by-class="org.apache.hadoop.examples.WordCount"/>

<hdp:job-runner id="myjob-runner" job-ref="myjob" run-at-startup="true"/>

当我运行一个存在 jar 的程序时,我从类路径中看到:-classpath "C:\Program Files\Java\jdk1.7.0_25\jre\lib\charsets.jar;... atd;C:\Users\JS185350 \WorkSpace\HBasePlaying\hadoop-examples\target\hadoop-examples-1.0-SNAPSHOT.jar;

创建名为“myjob”的 bean 时出错:调用 init 方法失败;嵌套异常是 java.io.FileNotFoundException:类路径资源 [classpath:hadoop-examples-1.0-SNAPSHOT.jar] 无法解析为 URL,因为它不存在

任何猜测可能是什么问题?

4

1 回答 1

0

/尝试在前面添加一个斜杠hadoop-examples...

    <hdp:job id="myjob" input-path="wordcount/in/" output-path="wordcount/outtttt/"
         mapper="org.apache.hadoop.examples.WordCount.TokenizerMapper"
         reducer="org.apache.hadoop.examples.WordCount.IntSumReducer"
         jar="classpath:/hadoop-examples-1.0-SNAPSHOT.jar"
         jar-by-class="org.apache.hadoop.examples.WordCount"/>

<hdp:job-runner id="myjob-runner" job-ref="myjob" run-at-startup="true"/>
于 2013-08-14T16:19:59.880 回答