E0701 XML schema error in OOZIE workflow

空扰寡人 提交于 2019-12-07 20:24:04

问题


The following is my workflow.xml

<workflow-app xmlns="uri:oozie:workflow:0.3" name="import-job">
<start to="createtimelinetable" />
 <action name="createtimelinetable">
   <sqoop xmlns="uri:oozie:sqoop-action:0.3">
              <job-tracker>${jobTracker}</job-tracker>
              <name-node>${nameNode}</name-node>
              <configuration>
                  <property>
                      <name>mapred.compress.map.output</name>
                      <value>true</value>
                  </property>
              </configuration>
              <command>import --connect jdbc:mysql://10.65.220.75:3306/automation --table ABC --username root</command>
   </sqoop>
   <ok to="end"/>
   <error to="end"/>
 </action>
 <end name="end"/>
</workflow-app>

Getting the following error on trying to submit the job:

Error: E0701 : E0701: XML schema error, cvc-elt.1.a: Cannot find the declaration of element 'action'.

However, oozie validate workflow.xml returns: Valid worflow-app

Anyone who faced and resolved a similar issue in the past?


回答1:


Confirm if you have copied your workflow.xml to hdfs. You need not copy job.properties to hdfs but have to copy all the other files and libraries to hdfs




回答2:


For those who reached here by googling the error message below is the general way to resolve Oozie schema issues:

Once your workflow.xml is complete, it's a best practice to validate it against oozie XSD schema file rather than submitting the Ooozie job and facing the issue later.

note on What is XSD schema: XSD schema is a kind of validation file which narrates,

a. Sequence of tags

b. whether a tag should be present or not

c. what are the valid sub-tags in a tag, etc.

How to validate workflow XML against XSD?

a. find out the specific XSD, this is seen in xmlns(xml namespace) property

< workflow-app name='FooBarWorkFlow' xmlns="uri:oozie:workflow:0.4">

in this case, it is uri:oozie:workflow:0.4. find the XSD file of uri:oozie:workflow:0.4(get it from appendix of Oozie official site or can be found easily by Googling)

b. There are numerous XML validation sites(example https://www.liquid-technologies.com/online-xsd-validator), provide your Workflow XML file ,XSD file and validate

Errors in workflow XML file will be listed out with line and column info. Rectify these, now use the valid Workflow XML file to avoid schema validation errors in oozie.



来源:https://stackoverflow.com/questions/23648624/e0701-xml-schema-error-in-oozie-workflow

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!