Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 193198

[Need Help] Error running command: null java.lang.ClassCastException - HQAPI

$
0
0

Hello,

i need your support on the following Error i got from hqapi when i try to do "./hqapi.sh alertdefinition sync". My command is:

 

# cat ad10100.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AlertDefinitionResponse>
     <Status>Success</Status>
     <AlertDefinition mtime="1331204852666" ctime="1331204068642" id="10100" name="Fs [ / ] ok" description="Filesystem sotto la soglia critica" priority="2" enabled="true" active="true" frequency="0" count="0" range="0" willRecover="false" notifyFiltered="false" controlFiltered="false">
         <Resource id="10910" name="rh-client Linux File System /dev/mapper/VolGroup00-LogVol00 mounted on / (local/ext3)"/>
         <AlertCondition required="true" type="1" thresholdValue="50.0" thresholdComparator="&lt;" thresholdMetric="Use Percent"/>
         <AlertAction id="10101" className="org.hyperic.hq.measurement.action.MetricAlertAction"/>
     </AlertDefinition>
</AlertDefinitionResponse>

 

# cat ad10100.xml | sh hqapi.sh alertdefinition sync

Error running command: null
java.lang.ClassCastException
     at java.lang.Class.cast(Class.java:2990)
     at org.hyperic.hq.hqapi1.XmlUtil.deserialize(XmlUtil.java:64)
     at org.hyperic.hq.hqapi1.tools.AlertDefinitionCommand.sync(AlertDefinitionCommand.java:439)
     at org.hyperic.hq.hqapi1.tools.AlertDefinitionCommand.handleCommand(AlertDefinitionCommand.java:152)
     at org.hyperic.hq.hqapi1.tools.Shell.dispatchCommand(Shell.java:245)
     at org.hyperic.hq.hqapi1.tools.Shell.main(Shell.java:260)

 

 

I test the following workaround but without success:

- try using ./hqapi.sh instead sh hqapi.sh

- try using different java bin (mine is /usr/java/default jdk6_u31), i tried /opt/hyperic/server-4.5.3/jre/bin/

- try sh hqapi.sh alertdefinition sync --file=ad10100.xml

- try to modify the XML removing <Status>Success</Status>

 

HQAPI version: hqapi1-client-4.3.0

Hyperic HQ version: 4.5.3-GA

 

I need to sync alertdefinitions based on XML files, please help me around this Error.

Thank you very much.

 

Claudio


Viewing all articles
Browse latest Browse all 193198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>