NoClassDefFoundError when starting zwave binding after upgrading to OH2 beta 4

After I upgraded to OH2 beta4 and zwave binding 2.0.0.201609142219 I have some exceptions in the log.

First

java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/eclipse/smarthome/config/discovery/ExtendedDiscoveryService
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_65]
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_65]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:179)[98:org.eclipse.smarthome.core:0.8.0.b5]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:72)[98:org.eclipse.smarthome.core:0.8.0.b5]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:56)[98:org.eclipse.smarthome.core:0.8.0.b5]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$7.run(ThingManager.java:684)[104:org.eclipse.smarthome.core.thing:0.8.0.b5]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_65]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
Caused by: java.lang.NoClassDefFoundError: org/eclipse/smarthome/config/discovery/ExtendedDiscoveryService
        at java.lang.ClassLoader.defineClass1(Native Method)[:1.8.0_65]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)[:1.8.0_65]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:272)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:588)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:540)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:527)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:395)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_65]
        at org.openhab.binding.zwave.handler.ZWaveControllerHandler.initializeNetwork(ZWaveControllerHandler.java:187)
        at org.openhab.binding.zwave.handler.ZWaveSerialHandler.initialize(ZWaveSerialHandler.java:99)
        at org.eclipse.smarthome.core.thing.internal.ThingManager$7$1.call(ThingManager.java:687)
        at org.eclipse.smarthome.core.thing.internal.ThingManager$7$1.call(ThingManager.java:1)
        at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:170)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
        ... 3 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.smarthome.config.discovery.ExtendedDiscoveryService cannot be found by org.openhab.binding.zwave_2.0.0.201609142219
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:382)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_65]
        ... 23 more

And later have NPEs of the following form:

java.lang.NullPointerException
        at org.openhab.binding.zwave.internal.protocol.serialmessage.SendDataMessageClass.handleRequest(SendDataMessageClass.java:70)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingRequestMessage(ZWaveController.java:242)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingMessage(ZWaveController.java:208)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.access$7(ZWaveController.java:202)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController$ZWaveInputThread.run(ZWaveController.java:1298)[190:org.openhab.binding.zwave:2.0.0.201609142219]
2016-09-15 23:11:10.192 [ERROR] [ve.internal.protocol.ZWaveController] - Exception during ZWave thread: Input 2. {}
java.lang.NullPointerException
        at org.openhab.binding.zwave.internal.protocol.serialmessage.SendDataMessageClass.handleRequest(SendDataMessageClass.java:70)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingRequestMessage(ZWaveController.java:242)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingMessage(ZWaveController.java:208)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.access$7(ZWaveController.java:202)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController$ZWaveInputThread.run(ZWaveController.java:1298)[190:org.openhab.binding.zwave:2.0.0.201609142219]
2016-09-15 23:11:10.201 [ERROR] [ve.internal.protocol.ZWaveController] - Exception during ZWave thread: Input 2. {}

Somewhere there is also an ArrayOutOfBounds:

2016-09-15 23:16:36.090 [ERROR] [ve.internal.protocol.ZWaveController] - Exception during ZWave thread: Input 2. {}
java.lang.ArrayIndexOutOfBoundsException: 8
        at org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveCommandClass.extractValue(ZWaveCommandClass.java:326)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveConfigurationCommandClass.processConfigurationReport(ZWaveConfigurationCommandClass.java:119)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveConfigurationCommandClass.handleApplicationCommandRequest(ZWaveConfigurationCommandClass.java:86)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.serialmessage.ApplicationCommandMessageClass.handleRequest(ApplicationCommandMessageClass.java:119)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingRequestMessage(ZWaveController.java:242)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingMessage(ZWaveController.java:208)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.access$7(ZWaveController.java:202)[190:org.openhab.binding.zwave:2.0.0.201609142219]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController$ZWaveInputThread.run(ZWaveController.java:1298)[190:org.openhab.binding.zwave:2.0.0.201609142219]```

Functionally It seems to work more or less. However, I did not test to much and there are many zwave errors ( dead node and timeout errors). Shall I report these exceptions as issues on github? 

Thank you for help

The first error (class not found) indicates to me that the runtime is not consistent with the binding. The ExtendedDiscoveryService was added quite recently - are you sure you upgraded to beta4 in a consistent way (ie the complete runtime was upgraded and you deleted all the temporary folders).

Not sure. I installed via

apt-get update
apt-get upgrade

and then did in karat a bindings:update for the zwave binding.

dpkg -l openhab2-online
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                       Version                            Architecture                       Description
+++-==========================================================-==================================-==================================-=========================================================================================================================
ii  openhab2-online                                            2.0.0~b4                           all                                openHAB Online Distribution

What temporary folders do I need to remove after updating?

The log states that there are bundles from ESH version 0.8.0.b5, which were the ones used in OH 2.0 beta3.
I assume that you upgraded from a previous version and that upgrade failed - you should note that there is still some issue with apt-get (@theo is working on it). It might help if you manually delete userdata/cache.

ok, thank you! deleteing /var/lib/openhab2/cache/* and restarting worked. There was also an old habmin 0.1.7-SNAPSHOT in the addons folder which caused some issues. I removed this as well and after restart the most exceptions disappeared. But I had to install the zwave binding and habmin new again resulting in some other NPEs. After another restart, all the exceptions are away. Now I have various zwave ERROR Messages about dead nodes and timeouts. I assume I have to invest some time to check if they are something serious. The one which concerns me most at the moment is:

2016-09-16 10:41:01.057 [ERROR] [ve.internal.protocol.ZWaveController] - NODE 4: Restore from config: Error deserialising XML file. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException: No such field org.openhab.
binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass.configAssociations
---- Debugging information ----
field               : configAssociations
class               : org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass
required-type       : org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /node/supportedCommandClasses/entry[5]/associationCommandClass/configAssociations
line number         : 372
class[1]            : java.util.HashMap
converter-type[1]   : com.thoughtworks.xstream.converters.collections.MapConverter
class[2]            : org.openhab.binding.zwave.internal.protocol.ZWaveNode
version             : 1.4.7
-------------------------------
2016-09-16 10:41:01.075 [ERROR] [ve.internal.protocol.ZWaveController] - NODE 5: Restore from config: Error deserialising XML file. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException: No such field org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass.configAssociations
---- Debugging information ----
field               : configAssociations
class               : org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass
required-type       : org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /node/supportedCommandClasses/entry[11]/associationCommandClass/configAssociations
line number         : 321
class[1]            : java.util.HashMap
converter-type[1]   : com.thoughtworks.xstream.converters.collections.MapConverter
class[2]            : org.openhab.binding.zwave.internal.protocol.ZWaveNode
version             : 1.4.7
-------------------------------
2016-09-16 10:41:01.078 [ERROR] [ve.internal.protocol.ZWaveController] - NODE 16: Restore from config: Error deserialising XML file. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException: No such field org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass.configAssociations
---- Debugging information ----
field               : configAssociations
class               : org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass
required-type       : org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /node/supportedCommandClasses/entry[7]/associationCommandClass/configAssociations
line number         : 155
class[1]            : java.util.HashMap
converter-type[1]   : com.thoughtworks.xstream.converters.collections.MapConverter
class[2]            : org.openhab.binding.zwave.internal.protocol.ZWaveNode
version             : 1.4.7
-------------------------------
2016-09-16 10:41:01.223 [ERROR] [ve.internal.protocol.ZWaveController] - NODE 6: Restore from config: Error deserialising XML file. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException: No such field org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass.configAssociations
---- Debugging information ----
field               : configAssociations
class               : org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass
required-type       : org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /node/supportedCommandClasses/entry[12]/associationCommandClass/configAssociations
line number         : 532
class[1]            : java.util.HashMap
converter-type[1]   : com.thoughtworks.xstream.converters.collections.MapConverter
class[2]            : org.openhab.binding.zwave.internal.protocol.ZWaveNode
version             : 1.4.7
-------------------------------

Do I have to do something with this?

Ignore these errors. This is caused by the XML format change between versions. The binding will automatically create the file (I might remove this error as it’s misleading).