Upgrade Guide: 19 to 20

From OpenNMS
Jump to: navigation, search

Collectd

Strict handling for threshold configuration

While migrating your configuration from 19 to 20, it is possible Horizon 20 starts but Collectd is not collecting performance data. You will find the following Exception in your collectd.log

initThresholdsDao: Could not initialize ThreshdConfigFactory

org.opennms.core.xml.MarshallingResourceFailureException: Failed to marshal/unmarshal XML file while unmarshalling an object (ThreshdConfiguration): javax.xml.bind.UnmarshalException
 - with linked exception:
[Exception [EclipseLink-25004] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: org.xml.sax.SAXParseException: A pseudo attribute name is expected. ]; nested exception is javax.xml.bind.UnmarshalException
 - with linked exception:
[Exception [EclipseLink-25004] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: org.xml.sax.SAXParseException: A pseudo attribute name is expected. ]
	at org.opennms.core.xml.MarshallingExceptionTranslator.translate(MarshallingExceptionTranslator.java:61)
	at org.opennms.core.xml.JaxbUtils.unmarshal(JaxbUtils.java:264)
	at org.opennms.core.xml.JaxbUtils.unmarshal(JaxbUtils.java:208)
	at org.opennms.core.xml.JaxbUtils.unmarshal(JaxbUtils.java:204)
	at org.opennms.netmgt.config.ThreshdConfigManager.<init>(ThreshdConfigManager.java:104)
	at org.opennms.netmgt.config.ThreshdConfigFactory.<init>(ThreshdConfigFactory.java:82)
	at org.opennms.netmgt.config.ThreshdConfigFactory.init(ThreshdConfigFactory.java:112)
	at org.opennms.netmgt.threshd.ThresholdingSet.initThresholdsDao(ThresholdingSet.java:383)
	at org.opennms.netmgt.threshd.ThresholdingSet.<init>(ThresholdingSet.java:96)
	at org.opennms.netmgt.threshd.CollectorThresholdingSet.<init>(CollectorThresholdingSet.java:72)
	at org.opennms.netmgt.threshd.ThresholdingVisitor.create(ThresholdingVisitor.java:108)
	at org.opennms.netmgt.collectd.CollectableService.<init>(CollectableService.java:175)
	at org.opennms.netmgt.collectd.Collectd.scheduleInterface(Collectd.java:524)
	at org.opennms.netmgt.collectd.Collectd.scheduleInterfacesWithService(Collectd.java:403)
	at org.opennms.netmgt.collectd.Collectd.access$400(Collectd.java:100)
	at org.opennms.netmgt.collectd.Collectd$3.doInTransactionWithoutResult(Collectd.java:385)
	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
	at org.opennms.netmgt.collectd.Collectd.scheduleExistingInterfaces(Collectd.java:378)
	at org.opennms.netmgt.collectd.Collectd.access$000(Collectd.java:100)
	at org.opennms.netmgt.collectd.Collectd$1$1.run(Collectd.java:307)
	at org.opennms.core.logging.Logging.withPrefix(Logging.java:71)
	at org.opennms.netmgt.collectd.Collectd$1.run(Collectd.java:303)
	at org.opennms.netmgt.scheduler.LegacyScheduler$1.run(LegacyScheduler.java:179)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.opennms.core.concurrent.LogPreservingThreadFactory$3.run(LogPreservingThreadFactory.java:124)
	at java.lang.Thread.run(Thread.java:748)
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[Exception [EclipseLink-25004] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: org.xml.sax.SAXParseException: A pseudo attribute name is expected. ]
	at org.eclipse.persistence.jaxb.JAXBUnmarshaller.handleXMLMarshalException(JAXBUnmarshaller.java:980)
	at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:303)
	at org.opennms.core.xml.JaxbUtils.unmarshal(JaxbUtils.java:259)
	... 26 more
Caused by: Exception [EclipseLink-25004] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: org.xml.sax.SAXParseException: A pseudo attribute name is expected. 
	at org.eclipse.persistence.exceptions.XMLMarshalException.unmarshalException(XMLMarshalException.java:114)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.convertSAXException(SAXUnmarshaller.java:999)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:496)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:695)
	at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:655)
	at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:301)
	... 27 more
Caused by: org.xml.sax.SAXParseException: A pseudo attribute name is expected. 
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
	at org.eclipse.persistence.internal.oxm.record.XMLReader.parse(XMLReader.java:221)
	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:492)
	... 30 more

The configuration reading is more strict in 20 than in 19, so make sure the configuration header in threshd-configuration.xml and thresholds.xml is the same as in $OPENNMS_HOME/share/etc-pristine:

<?xml version="1.0"?>
<threshd-configuration threads="5">

<?xml version="1.0" encoding="UTF-8"?>
<thresholding-config xmlns="http://xmlns.opennms.org/xsd/config/thresholding">

Restarting Horizon and check your collectd.log and the Exception should be gone.