Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Oozie work flow validation error.

Oozie work flow validation error.

Expert Contributor

Can anybody let me know where I am going wrong in the below workflow?

<workflow-app xmlns="uri:oozie:workflow:0.4" name="wf">
 <start to="create"/>  
  <action name="create">
     <pig>
         <job-tracker>${jobTracker}</job-tracker>
         <name-node>${namenode}</name-node>
         <prepare>
             <delete path="${nameNode}/user/${appRoot}/Output"/>
         </prepare>
         <configuration>
             <property>
                 <name>mapred.job.queue.name</name>
                 <value>${queueName}</value>
             </property>
             <property>
                 <name>mapred.compress.map.output</name>
                 <value>true</value>
             </property>
         </configuration>
         <script>script.pig</script>
         <param>input=/user/${appRoot}/clean.log</param>
         <param>output=/user/${appRoot}/Output</param>
     </pig>
     <ok to="end"/>
     <error to="fail"/>
  </action> 
  <kill name="fail">
    <message>Process killed</message>
  </kill>
 <end name="end"/>
</workflow-app>

I get the below error

Error: E0701: XML schema error, /Oozie/app/test1.xml, org.xml.sax.SAXParseException; lineNumber: 31; columnNumber: 16; cvc-complex-type.2.3: Element 'workflow-app' cannot have character [children], because the type's content type is element-only.
1 REPLY 1
Highlighted

Re: Oozie work flow validation error.

Super Guru

@Alex Raj - I copied your workflow and tried to validate, I can see that its a valid workflow.xml

[root@sandbox ~]# oozie validate workflow.xml
Valid workflow-app



[root@sandbox ~]# cat workflow.xml
<workflow-app xmlns="uri:oozie:workflow:0.4" name="wf">
 <start to="create"/>
  <action name="create">
     <pig>
         <job-tracker>${jobTracker}</job-tracker>
         <name-node>${namenode}</name-node>
         <prepare>
             <delete path="${nameNode}/user/${appRoot}/Output"/>
         </prepare>
         <configuration>
             <property>
                 <name>mapred.job.queue.name</name>
                 <value>${queueName}</value>
             </property>
             <property>
                 <name>mapred.compress.map.output</name>
                 <value>true</value>
             </property>
         </configuration>
         <script>script.pig</script>
         <param>input=/user/${appRoot}/clean.log</param>
         <param>output=/user/${appRoot}/Output</param>
     </pig>
     <ok to="end"/>
     <error to="fail"/>
  </action>
  <kill name="fail">
    <message>Process killed</message>
  </kill>
 <end name="end"/>
</workflow-app>

Also I was able to run Oozie job using your workflow.xml

[root@sandbox ~]# oozie job -oozie http://localhost:11000/oozie -config job.properties -run
job: 0000006-160528225630364-oozie-oozi-W


[root@sandbox ~]# ls -lrt workflow.xml script.pig
-rw-r--r-- 1 root root 977 2016-05-31 05:10 workflow.xml
-rw-r--r-- 1 root root 930 2016-05-31 05:12 script.pig
[root@sandbox ~]#

Can you please open workflow.xml in vim/vi editor on your oozie client and run ':set list' command in vi editor to see if you are having any special unwanted characters in workflow.xml?

Please see my output screenshot for your reference:

4664-screen-shot-2016-05-31-at-104506-am.png

Don't have an account?
Coming from Hortonworks? Activate your account here