Handler_Missing_Error when addding Update xml

Hello,

I am getting a

Handler_Missing_Error

as soon if I add the following instructions.xml to OH-INF/update

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
	xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">

	<thing-type uid="sonnen:sonnenbattery">

		<instruction-set targetVersion="1">
			<add-channel id="energyImportedStateProduction">
				<type>sonnen:energyImportedStateProduction</type>
			</add-channel>
			<add-channel id="energyExportedStateProduction">
				<type>sonnen:energyExportedStateProduction</type>
			</add-channel>
			<add-channel id="energyImportedStateConsumption">
				<type>sonnen:energyImportedStateConsumption</type>
			</add-channel>
			<add-channel id="energyExportedStateConsumption">
				<type>sonnen:energyExportedStateConsumption</type>
			</add-channel>
		</instruction-set>
	</thing-type>
</update:update-descriptions>

I was able to debug and found the code where the Handler is returning null. It is actually in the ThingManagerImplin this method:

  private @Nullable ThingHandlerFactory findThingHandlerFactory(ThingTypeUID thingTypeUID) {
        return thingHandlerFactories.stream().filter(factory -> factory.supportsThingType(thingTypeUID)).findFirst()
                .orElse(null);
    }

As soon as I paste my instructions.xml in the binding and compile it, this method returns null otherwise the handler is given.
Can somebody point out where do I have to look for the root cause?

I also noticed, that as soon as the instructions.xml is part of my binding project I get the following error in my console log in Eclipse:

java.lang.NoSuchMethodError: 'java.lang.Object javax.xml.bind.ServiceLoaderUtil.lookupUsingOSGiServiceLoader(java.lang.String, java.util.logging.Logger)'
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:413) ~[?:?]
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:721) ~[?:?]
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:662) ~[?:?]
	at org.openhab.core.thing.internal.update.ThingUpdateInstructionReader.readForFactory(ThingUpdateInstructionReader.java:71) ~[?:?]
	at org.openhab.core.thing.internal.ThingManagerImpl.addThingHandlerFactory(ThingManagerImpl.java:1140) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:245) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:687) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:531) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BindMethod.invoke(BindMethod.java:42) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:2086) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:2061) ~[?:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:443) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:336) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:304) ~[?:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1232) ~[?:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1152) ~[?:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:959) ~[?:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:895) ~[?:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1184) ~[?:?]
	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:116) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:120) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:956) ~[?:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) ~[?:?]
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:936) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:873) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:141) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:261) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:495) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:929) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:915) ~[?:?]
	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:133) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:984) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:752) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:674) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:437) ~[?:?]
	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:671) ~[?:?]
	at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:310) ~[?:?]
	at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:593) ~[?:?]
	at org.apache.felix.scr.impl.Activator.access$200(Activator.java:74) ~[?:?]
	at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:460) ~[?:?]
	at org.apache.felix.scr.impl.AbstractExtender.createExtension(AbstractExtender.java:196) ~[?:?]
	at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:169) ~[?:?]
	at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:49) ~[?:?]
	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:944) ~[?:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) ~[?:?]
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:229) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:138) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:130) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:217) ~[?:?]
	at org.eclipse.osgi.container.Module.publishEvent(Module.java:499) ~[?:?]
	at org.eclipse.osgi.container.Module.start(Module.java:486) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[?:?]
	at aQute.launcher.Launcher.start(Launcher.java:699) ~[?:?]
	at aQute.launcher.Launcher.startBundles(Launcher.java:679) ~[?:?]
	at aQute.launcher.Launcher.activate(Launcher.java:585) ~[?:?]
	at aQute.launcher.Launcher.launch(Launcher.java:404) ~[?:?]
	at aQute.launcher.Launcher.run(Launcher.java:186) ~[?:?]
	at aQute.launcher.Launcher.main(Launcher.java:162) ~[?:?]
	at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:170) ~[biz.aQute.launcher.pre.jar:?]
	at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:135) ~[biz.aQute.launcher.pre.jar:?]
	at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:52) ~[biz.aQute.launcher.pre.jar:?]

It is a runtime linker error. It comes from JAXB which is managed by openhab distro and not your binding. there is probably mismatch between versions - jaxb-ri vs jaxb-api or similar. What does shell give you back after calling la -l|grep -i jaxb?

How do I get to the shell when I run my openhab instance out of eclipse in debug modus?

You likely need to include org.apache.karaf.shell.core bundle and its dependencies. To be fair I do not run eclipse so I can’t tell for sure.

JAXB feature looks fine: openhab-core/feature.xml at main · openhab/openhab-core · GitHub (both are aligned).

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