oozie java操作错误java.lang.noclassdeffounderror:org/apache/poi/xwpf/usermodel/xwpfdocument

s4n0splo  于 2021-05-29  发布在  Hadoop
关注(0)|答案(2)|浏览(458)

我正在尝试为java操作运行oozie工作流。我的java代码可以从hdfs读取word文件,并在hdfs上写回csv文件。my workflow.xml包含-

<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns="uri:oozie:workflow:0.4" name="Word-Processing">
<start to="PathologyReport-Processing"/>
<action name="PathologyReport-Processing">
<java>
  <job-tracker>${jobTracker}</job-tracker>
  <name-node>${nameNode}</name-node>
 <configuration>
  <property>
   <name>mapred.job.queue.name</name>
   <value>${queueName}</value>
  </property>
  <property>
   <name>oozie.libpath</name>
   <value>${JarPath}</value>
  </property>
 </configuration>
 <main-class>${MainClass}</main-class>
 <arg>-libjars</arg>
 <arg>${JarPath}</arg>
 <arg>${in}</arg>
 <arg>${out}</arg>
</java>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Java Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>

my job.properties包含以下代码

nameNode=hdfs://CTSC00385700501:8020
jobTracker=CTSC00385700501:8032
workflowRoot=PathologyReport
queueName=default
MainClass=SampleUnstructured
JarPath=hdfs://localhost:8020/user/oozie/${workflowRoot}/lib/poi-3.9.jar
in=hdfs://localhost:8020/user/oozie/${workflowRoot}/SampleWord.docx
out=hdfs://localhost:8020/user/oozie/${workflowRoot}/output
oozie.use.system.libpath=true
oozie.libpath=hdfs://localhost:8020/user/oozie/share/lib/lib_20150513153121/
oozie.wf.application.path=hdfs://localhost:8020/user/oozie/${workflowRoot}

我已经为apache poi jar文件指定了路径,但仍然无法找到它。请帮我解决这个问题。提前谢谢。

h22fl7wq

h22fl7wq1#

来自oozie mapreduce食谱:
…请注意,oozie不支持hadoop命令行支持的-libjars选项。。。
使用oozie,您应该在操作中添加元素,以引用运行时自动下载到yarn容器的working dir中的jar。

yqyhoc1h

yqyhoc1h2#

你能检查一下你提到的job.property配置吗。据我所知 ${workflowRoot} “参数应为workflow.xml中的mentnion,而job.xml应定义为

<property> 
<name>workflowRoot</name>
<value>${workflowRoot}</value> 
</property>

然后试着去做这件事,相信这些都能奏效。

相关问题