Affects Version/s: None
Fix Version/s: None
Right now validating a workflow, coordinator, bundle, SLA xml against the provided schemas are happenning in different ways.
- Validating a coordinator xml with oozie validate:
Here we try to validate against all possible schemas. Validation depends on a magic string "cvc-elt.1.a" in the exception's message that I believe is questionable. It is not present in all xercesImpl versions, and my cause problems if Oozie server loads earlier versions of xercesImpl. For example: we get a SAXParseException in the first iteration when validating against the workflow schemas if Xerces classes are loaded from xercesImpl 2.9.1:
- Submitting a coordinator xml with oozie job ... -submit:
Here only coordinator schemas are used for the validation.
Validation during bundle submission happens in similar way : https://github.com/apache/oozie/blob/5998c18fde1da769e91e3ef1bcca484723730c76/core/src/main/java/org/apache/oozie/command/bundle/BundleSubmitXCommand.java#L289.
During workflow submission, validation is a bit more complex: https://github.com/apache/oozie/blob/branch-4.3/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowAppParser.java#L169
It would be a better solution to have a common validation logic for job (workflow, coordinator, bundle, etc) submission and xml validation with oozie validate. We should only validate XML against the given entity's schema(s) (e.g. coording), and not against each schema. V2ValidateServlet should not (re)implement xml validation.