Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
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:
https://github.com/apache/oozie/blob/branch-4.3/core/src/main/java/org/apache/oozie/servlet/V2ValidateServlet.java#L125
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:oozie validate -oozie http://localhost:11000/oozie /tmp/coordinator.xml Error: E0701: XML schema error, /tmp/coordinator.xml, org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 43; cvc-elt.1: Cannot find the declaration of element 'coordinator-app'.
- Submitting a coordinator xml with oozie job ... -submit:
https://github.com/apache/oozie/blob/branch-4.3/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java#L495
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.
Attachments
Issue Links
- is related to
-
OOZIE-2746 Several tests failure in TestV2ValidateServlet.java
- Closed