Errors parsing XML documents when running openHAB under Eclipse

I’m getting 18 errors like the following when I start openHAB under Eclipse (2021-03). This particular one is for the file /OH-INF/config/inbox.xml, but I’m guessing there is one for every XML config file it tries to parse on startup.

org.openhab.core.config.xml [org.openhab.core.config.xml.osgi.XmlDocumentBundleTracker] WARN : The XML document '/OH-INF/config/inbox.xml' in module 'org.openhab.core.config.discovery' could not be parsed: class com.sun.xml.internal.stream.XMLInputFactoryImpl cannot be cast to class javax.xml.stream.XMLInputFactory (com.sun.xml.internal.stream.XMLInputFactoryImpl is in module java.xml of loader 'bootstrap'; javax.xml.stream.XMLInputFactory is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @72825400)
java.lang.ClassCastException: class com.sun.xml.internal.stream.XMLInputFactoryImpl cannot be cast to class javax.xml.stream.XMLInputFactory (com.sun.xml.internal.stream.XMLInputFactoryImpl is in module java.xml of loader 'bootstrap'; javax.xml.stream.XMLInputFactory is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @72825400)
	at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:41)
	at com.thoughtworks.xstream.io.xml.StaxDriver.createInputFactory(StaxDriver.java:241)
	at com.thoughtworks.xstream.io.xml.StaxDriver.getInputFactory(StaxDriver.java:197)
	at com.thoughtworks.xstream.io.xml.StaxDriver.createParser(StaxDriver.java:234)
	at com.thoughtworks.xstream.io.xml.StaxDriver.createReader(StaxDriver.java:110)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1339)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1293)
	at org.openhab.core.config.xml.util.XmlDocumentReader.readFromXML(XmlDocumentReader.java:106)
	at org.openhab.core.config.xml.osgi.XmlDocumentBundleTracker.parseDocuments(XmlDocumentBundleTracker.java:396)
	at org.openhab.core.config.xml.osgi.XmlDocumentBundleTracker.processBundle(XmlDocumentBundleTracker.java:382)
	at org.openhab.core.config.xml.osgi.XmlDocumentBundleTracker$2.run(XmlDocumentBundleTracker.java:347)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Since this is preventing proper configuration of openhab, it isn’t behaving normally.

It worked previously, but I hadn’t tried to use the dev enviroment in a few weeks, and it was broken in a variety of ways when I tried to work on a binding today. I had to attempt all the usual fixes such as pulling the latest openhab-addons, pulling the latest openhab-distro and rebasing my development branch on top of it, running Maven Update Project in Eclipse, then re-resolving app.bndrun, and finally removing my .m2 cache directory and rebuilding. This is the last remaining problem, which I can’t seem to fix. Is anyone else seeing this?

Strangely, I was finally able to fix this by updating Eclipse (via Help/Check for Updates). So if you run in to a similar problem, try that. I wish the dev environment wasn’t so fragile!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.