[ 
https://issues.apache.org/jira/browse/OOZIE-859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13289538#comment-13289538
 ] 

John Armstrong commented on OOZIE-859:
--------------------------------------

I only noticed it in the one case, but it should happen for any Properties 
entry with an all-whitespace value.

The code in question is in OozieClient.writeToXml, in the lines

Element valueNode = doc.createElement("value");
valueNode.appendChild(doc.createTextNode(value.trim()));
propNode.appendChilde(valueNode);

If value is "" or " " or anything else that trims to an empty string, 
doc.createTextNode() behaves differently:

"foo" => <value>foo</value>
""    => </value>

As for a solution, I don't know if fidgeting with the way the XML Document is 
constructed is a good idea.  Maybe the parser on the other end can interpret 
</value> tags as "".  The only catch here is that somewhere between submitting 
the HTTP request and the Job Configuration showing up in the Oozie server 
console, the "valueless" property tag disappears completely.

Does that make sense?
                
> OozieClient has trouble with "blank" properties
> -----------------------------------------------
>
>                 Key: OOZIE-859
>                 URL: https://issues.apache.org/jira/browse/OOZIE-859
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: John Armstrong
>            Priority: Minor
>
> When writing the Properties in a JobSubmit object as XML to an 
> HttpConnection's OutputStream, it trims the string values.  If the string is 
> empty (""), this leads to no value in the Job Configuration, which causes 
> problems in workflows expecting a value for the property.

--
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

        

Reply via email to