You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Virag Kothari (JIRA)" <ji...@apache.org> on 2012/05/13 06:43:40 UTC

[jira] [Updated] (OOZIE-571) Oozie validate command doesnt work for schema 0.2

     [ https://issues.apache.org/jira/browse/OOZIE-571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Virag Kothari updated OOZIE-571:
--------------------------------


For the patch committed in trunk with this JIRA ID (also available under the same JIRA ID in Apache ReviewBoard system), I grant license to ASF for inclusion in ASF works (as per the Apache License ยง5) 
                
> Oozie validate command doesnt work for schema 0.2 
> --------------------------------------------------
>
>                 Key: OOZIE-571
>                 URL: https://issues.apache.org/jira/browse/OOZIE-571
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: Virag Kothari
>            Assignee: Virag Kothari
>             Fix For: pre-Apache
>
>
> Hi,
> Validating the workflow using "oozie validate" command doesnt work with schema 0.2
> workflow.xml
> ========
> <workflow-app xmlns='uri:oozie:workflow:0.2' name='pig-wf'>
>     <start to='pig1' />
>     <action name='pig1'>
>         <pig>
>             <job-tracker>${jobTracker}</job-tracker>
>             <name-node>${nameNode}</name-node>
>             <configuration>
>                 <property>
>                   <name>mapred.job.queue.name</name>
>                   <value>${queueName}</value>
>                 </property>
>             </configuration>
>             <script>id.pig</script>
>         </pig>
>         <ok to='end' />
>         <error to='fail' />
>     </action>
>     <kill name='fail'>
>         <message>Pig failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
>     </kill>
>     <end name='end' />
> </workflow-app>
> =========
> [anithar pig]$  oozie validate workflow.xml
> Error: Invalid workflow-app, org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element
> 'workflow-app'.
> This workflow.xml when run after putting in hdfs works good. 
> The validate command works fine if the schema is 0.1.
> =========
> <workflow-app xmlns='uri:oozie:workflow:0.1' name='pig-wf'>
> =========
> [anithar pig]$  oozie validate workflow.xml
> Valid worflow-app
> I am assuming, from the code, i see that for the validate command, the schema is checked across only
> oozie-workflow-0.1.xsd. This is the schema definition for 0.1.
> ------------
> try {
>                 List<StreamSource> sources = new ArrayList<StreamSource>();
>                 sources.add(new StreamSource(Thread.currentThread().getContextClassLoader().getResourceAsStream(
>                         "oozie-workflow-0.1.xsd")));
>                 sources.add(new StreamSource(Thread.currentThread().getContextClassLoader().getResourceAsStream(
>                         "email-action-0.1.xsd")));
>                 sources.add(new StreamSource(Thread.currentThread().getContextClassLoader().getResourceAsStream(
>                         "distcp-action-0.1.xsd")));
>                 SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
>                 Schema schema = factory.newSchema(sources.toArray(new StreamSource[sources.size()]));
>                 Validator validator = schema.newValidator();
>                 validator.validate(new StreamSource(new FileReader(file)));
>                 System.out.println("Valid worflow-app");
>             }
> catch (Exception ex) {
>         throw new OozieCLIException("Invalid workflow-app, " + ex.toString(), ex);
>             }
> -------------
> Regards,
> Anitha

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira