On a bright sunny day, without any prior warning (as it usually happens in DEV environment) our HP BSM Connector decided that it doesn’t want to show any policies in the UI and instead to present me with “An unexpected error occurred” kind of message:
After asking for more details this message box was kind enough to reveal some more information:
Here is the exception in a more readable form:
faultCode=Server.Processing faultString=com.hp.opr.policymanagement.exception.PolicyManagementException : Error parsing XML [JDOMParseException]: Error on line 1: Premature end of file. faultDetail=null message=(mx.messaging.messages::ErrorMessage)#0 body = (null) clientId = "5350AC36-3C0F-81F1-8467-BF33183EE63A" correlationId = "E601AE91-C1FD-E6E5-4635-39106774BBC1" destination = "policyManagementService" extendedData = (null) faultCode = "Server.Processing" faultDetail = (null) faultString = "com.hp.opr.policymanagement.exception.PolicyManagementException : Error parsing XML [JDOMParseException]: Error on line 1: Premature end of file." headers = (Object)#1 messageId = "53510DD2-070E-D6D9-870F-3307D13C1DAA" rootCause = (Object)#2 cause = (Object)#3 cause = (Object)#4 cause = (null) columnNumber = 1 exception = (null) lineNumber = 1 localizedMessage = "Premature end of file." message = "Premature end of file." publicId = (null) suppressed = (Array)#5 systemId = (null) columnNumber = 1 lineNumber = 1 localizedMessage = "Error on line 1: Premature end of file." message = "Error on line 1: Premature end of file." partialDocument = (null) publicId = (null) suppressed = (Array)#5 systemId = (null) exceptionCode = "XML_PARSING_ERROR" localizedMessage = "Error parsing XML [JDOMParseException]: Error on line 1: Premature end of file." message = "Error parsing XML [JDOMParseException]: Error on line 1: Premature end of file." suppressed = (Array)#5 timestamp = 1409706649591 timeToLive = 0
When HP BSM Connector policies and XML are mentioned in one sentence the 2 locations that come in mind are
- %OVDataDir%\datafiles\policies – that’s where all the policies that appear in the HP BSM Connector UI exist
- %OVDataDir%\datafiles\policymanagement\store – that’s the “main’ store location of the policies.
After having a quick look at the XML files in the first location and not seeing anything interesting I switched my focus on the second location and here I’ve noticed one “anomaly”. One of the _header.xml files’ size was 0 bytes.
Apparently someone (not excluding myself from the list of suspects) was working on a policy when the machine, BSM Connector is installed on, ran out of space. It is very possible that some warning message was displayed back then or the UI just hang, but since it’s DEV environment no one really cared and just restarted the HP BSM Connector service. The space issue was solved but the _header.xml file, of the policy that has been edited at the time of the crash, became “corrupted”.
After deleting the .lock and .active files and replacing the _data and _header.xml files of the problematic policy in the %OVDataDir%\datafiles\policymanagement\store with the ones from %OVDataDir%\datafiles\policies , saying a short prayer to the Lords of policies and hitting the refresh button in the HP BSM Connector UI I was pleased to see the UI showing all of my lovely policies and not the annoying error message.