Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.10.3
-
Fix Version/s: 1.10.4
-
Component/s: Data Collection - XML
-
Security Level: Default (Default Security Scheme)
-
Labels:None
Description
Les Mikesell from the mailing list has reported an error related with the XML collector, when collecting data for nodes managed by Capsd.
These nodes contains null for foreignSource and foreignId which are breaking the code for AbstractXmlCollectionHandler.parseUrl(). Here is part of the current code:
url = url.replace("{nodeId}", node.getNodeId());
url = url.replace("{nodeLabel}", node.getLabel());
url = url.replace("{foreignId}", node.getForeignId());
url = url.replace("{foreignSource}", node.getForeignSource());
The solution is to check if the following node's parameters are null or not before calling the replace method: foreignId, foreignSource and nodeLabel.
These nodes contains null for foreignSource and foreignId which are breaking the code for AbstractXmlCollectionHandler.parseUrl(). Here is part of the current code:
url = url.replace("{nodeId}", node.getNodeId());
url = url.replace("{nodeLabel}", node.getLabel());
url = url.replace("{foreignId}", node.getForeignId());
url = url.replace("{foreignSource}", node.getForeignSource());
The solution is to check if the following node's parameters are null or not before calling the replace method: foreignId, foreignSource and nodeLabel.
Effectively I could reproduce the problem and adding the null checking has fixed it.
Committed on revision f124761888f801406135ce5573cdfd3df5dc36ef for 1.10