Monitoring Plugin 2.7.0 Error

Hi,

After upgrading to Openfire 5, the Monitoring Service 2.7.0 plugin generates the following errors in the logs. Can someone help?

2025.06.27 19:30:12.334 INFO [PluginMonitorExec-2]: org.jivesoftware.database.SchemaManager - Found old database version 8 for monitoring. Upgrading to version 9...
2025.06.27 19:30:12.422 INFO [PluginMonitorExec-2]: org.jivesoftware.database.SchemaManager - Database update successful.
2025.06.27 19:30:13.656 ERROR [PluginMonitorExec-2]: org.jivesoftware.util.XMLProperties - Error reading XML properties
org.dom4j.DocumentException: Error on line 1 of document : Premature end of file.
    at org.dom4j.io.SAXReader.read(SAXReader.java:511) ~[dom4j-2.1.4.jar:?]
    at org.dom4j.io.SAXReader.read(SAXReader.java:408) ~[dom4j-2.1.4.jar:?]
    at org.jivesoftware.util.XMLProperties.buildDoc(XMLProperties.java:810) ~[xmppserver-5.0.0.jar:5.0.0]
    at org.jivesoftware.util.XMLProperties.<init>(XMLProperties.java:160) ~[xmppserver-5.0.0.jar:5.0.0]
    at org.jivesoftware.openfire.index.LuceneIndexer.loadPropertiesFile(LuceneIndexer.java:515) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.index.LuceneIndexer.start(LuceneIndexer.java:109) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.plugin.MonitoringPlugin.initializePlugin(MonitoringPlugin.java:189) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:637) ~[xmppserver-5.0.0.jar:5.0.0]
    at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask.lambda$run$3(PluginMonitor.java:354) ~[xmppserver-5.0.0.jar:5.0.0]
    at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204) ~[?:?]
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:178) ~[?:?]
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) ~[?:?]
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) ~[?:?]
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1465) ~[?:?]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1013) ~[?:?]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) ~[?:?]
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:114) ~[?:?]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542) ~[?:?]
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889) ~[?:?]
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825) ~[?:?]
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) ~[?:?]
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224) ~[?:?]
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637) ~[?:?]
    at org.dom4j.io.SAXReader.read(SAXReader.java:494) ~[dom4j-2.1.4.jar:?]
    ... 12 more
2025.06.27 19:30:13.658 ERROR [PluginMonitorExec-2]: org.jivesoftware.openfire.archive.ArchiveIndexer[CONVERSATION] - An exception occurred while initializing the Lucene index that is expected to exist in: /usr/share/openfire/monitoring/search
java.io.IOException: Error on line 1 of document : Premature end of file.
    at org.jivesoftware.util.XMLProperties.buildDoc(XMLProperties.java:814) ~[xmppserver-5.0.0.jar:5.0.0]
    at org.jivesoftware.util.XMLProperties.<init>(XMLProperties.java:160) ~[xmppserver-5.0.0.jar:5.0.0]
    at org.jivesoftware.openfire.index.LuceneIndexer.loadPropertiesFile(LuceneIndexer.java:515) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.index.LuceneIndexer.start(LuceneIndexer.java:109) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.plugin.MonitoringPlugin.initializePlugin(MonitoringPlugin.java:189) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:637) ~[xmppserver-5.0.0.jar:5.0.0]
    at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask.lambda$run$3(PluginMonitor.java:354) ~[xmppserver-5.0.0.jar:5.0.0]
    at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.lang.Thread.run(Thread.java:1583) [?:?]
2025.06.27 19:30:13.658 ERROR [PluginMonitorExec-2]: org.jivesoftware.openfire.container.PluginManager - An exception occurred while loading plugin 'monitoring':
java.lang.NullPointerException: Cannot invoke "org.jivesoftware.util.XMLProperties.getProperty(String)" because "this.indexProperties" is null
    at org.jivesoftware.openfire.index.LuceneIndexer.getLastModified(LuceneIndexer.java:221) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.index.LuceneIndexer.start(LuceneIndexer.java:183) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.plugin.MonitoringPlugin.initializePlugin(MonitoringPlugin.java:189) ~[monitoring-2.7.0.jar:?]
    at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:637) ~[xmppserver-5.0.0.jar:5.0.0]
    at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask.lambda$run$3(PluginMonitor.java:354) ~[xmppserver-5.0.0.jar:5.0.0]
    at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.lang.Thread.run(Thread.java:1583) [?:?]

This is caused by having corrupt files in the directory where Openfire stores the Lucene indices. These indices are used for full-text search.

The files are stored in the monitoring subdirectory of your Openfire installation (typically C:\Program Files\Openfire\monitoring or /opt/openfire/monitoring/). That directory typically holds three subdirectories, that each hold an index. Part of that index is a file called indexprops.xml, which in your case seems to be corrupt (it is not unlikely that other files in that index are also corrupt).

The Lucene indices do not hold unique data: they can be regenerated from database content. Openfire should do this automatically when it detects that the indices are missing. This can be a resource intensive task, but only if you store a lot of message history (typically, it’s fine).

My advise is to shut down Openfire, delete that directory (after creating a backup), then restart Openfire. That should cause Openfire to re-generate the directory and the indices within it.

Removing the /usr/share/openfire/monitoring folder resolved the issue. Thank you.

1 Like