Item update results in Exception occurred while calling thing updated at ThingHandler

OpenHab 2.1 with Zwave 2.1.0 binding.

I have a problem with one of the ZWave Thing. When I open the Thing from the PeperUI and then save the Thing it results in a 500 error. I turned on debug and it shows the following.

What is interesting is the
2017-09-26 17:29:07.157 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Property to update: group_5, null, null
just before the
java.lang.NullPointerException
occurs.

The value passed is actually a null so the NullPointerException makes sense.

2017-09-26 17:29:07.076 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_32_2
2017-09-26 17:29:07.077 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_32_2 len=3
2017-09-26 17:29:07.079 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_32_2 - id = '32'
2017-09-26 17:29:07.080 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_10_1
2017-09-26 17:29:07.082 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_10_1 len=3
2017-09-26 17:29:07.083 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_10_1 - id = '10'
2017-09-26 17:29:07.084 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_5
2017-09-26 17:29:07.086 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_4
2017-09-26 17:29:07.087 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@15903cf
2017-09-26 17:29:07.088 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_1
2017-09-26 17:29:07.090 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_3
2017-09-26 17:29:07.091 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_2
2017-09-26 17:29:07.093 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@5459cc
2017-09-26 17:29:07.094 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing action_reinit
2017-09-26 17:29:07.095 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@1c4e5ed
2017-09-26 17:29:07.097 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing wakeup_node
2017-09-26 17:29:07.098 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_12_2
2017-09-26 17:29:07.100 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_12_2 len=3
2017-09-26 17:29:07.101 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_12_2 - id = '12'
2017-09-26 17:29:07.102 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_11_2
2017-09-26 17:29:07.104 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_11_2 len=3
2017-09-26 17:29:07.105 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_11_2 - id = '11'
2017-09-26 17:29:07.106 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_13_1
2017-09-26 17:29:07.108 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_13_1 len=3
2017-09-26 17:29:07.109 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_13_1 - id = '13'
2017-09-26 17:29:07.110 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_20_2
2017-09-26 17:29:07.112 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_20_2 len=3
2017-09-26 17:29:07.113 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_20_2 - id = '20'
2017-09-26 17:29:07.115 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_21_1
2017-09-26 17:29:07.116 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_21_1 len=3
2017-09-26 17:29:07.118 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_21_1 - id = '21'
2017-09-26 17:29:07.119 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@f8f268
2017-09-26 17:29:07.121 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@1fa7313
2017-09-26 17:29:07.122 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@1d5e220
2017-09-26 17:29:07.123 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@8dcb84
2017-09-26 17:29:07.125 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing action_failed
2017-09-26 17:29:07.126 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing wakeup_interval
2017-09-26 17:29:07.127 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing powerlevel_level
2017-09-26 17:29:07.128 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing action_remove
2017-09-26 17:29:07.129 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing binding_pollperiod
2017-09-26 17:29:07.130 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing action_heal
2017-09-26 17:29:07.132 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_1_1
2017-09-26 17:29:07.133 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_1_1 len=3
2017-09-26 17:29:07.134 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_1_1 - id = '1'
2017-09-26 17:29:07.135 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@1e20d97
2017-09-26 17:29:07.136 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_2_1
2017-09-26 17:29:07.137 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_2_1 len=3
2017-09-26 17:29:07.139 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_2_1 - id = '2'
2017-09-26 17:29:07.140 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@169809e
2017-09-26 17:29:07.141 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@1e03069
2017-09-26 17:29:07.142 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing powerlevel_timeout
2017-09-26 17:29:07.143 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_3_1
2017-09-26 17:29:07.144 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_3_1 len=3
2017-09-26 17:29:07.145 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_3_1 - id = '3'
2017-09-26 17:29:07.147 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_4_1
2017-09-26 17:29:07.148 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_4_1 len=3
2017-09-26 17:29:07.149 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Processing config_4_1 - id = '4'
2017-09-26 17:29:07.150 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Update ASSOCIATION group_org.openhab.binding.zwave.internal.protocol.ZWaveAssociationGroup@f8f268: Adding node_1_0
2017-09-26 17:29:07.153 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Property to update: config_30_1, 55, 55
2017-09-26 17:29:07.153 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Property to update: config_31_2, 1, 1
2017-09-26 17:29:07.155 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Property to update: config_32_2, 180, 180
2017-09-26 17:29:07.156 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Property to update: config_10_1, 0, 0
2017-09-26 17:29:07.157 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Property to update: group_5, null, null
2017-09-26 17:29:07.164 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occurred while calling thing updated at ThingHandler 'org.openhab.binding.zwave.handler.ZWaveThingHandler@c77928': java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_121]
	at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_121]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:194)
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:83)
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:67)
	at org.eclipse.smarthome.core.thing.internal.ThingManager.thingUpdated(ThingManager.java:524)
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyTrackers(ThingRegistryImpl.java:221)
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:144)
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:1)
	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.updated(AbstractRegistry.java:177)
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:57)
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutUpdatedElement(AbstractProvider.java:82)
	at org.eclipse.smarthome.core.common.registry.AbstractManagedProvider.update(AbstractManagedProvider.java:133)
	at org.eclipse.smarthome.io.rest.core.thing.ThingResource.update(ThingResource.java:437)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_121]
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
	at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76)[9:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[79:org.eclipse.jetty.security:9.2.19.v20160908]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.Server.handle(Server.java:499)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[71:org.eclipse.jetty.io:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[83:org.eclipse.jetty.util:9.2.19.v20160908]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: java.lang.NullPointerException
	at org.openhab.binding.zwave.handler.ZWaveThingHandler.updateNodeProperties(ZWaveThingHandler.java:1403)[184:org.openhab.binding.zwave:2.1.0]
	at org.openhab.binding.zwave.handler.ZWaveThingHandler.bridgeStatusChanged(ZWaveThingHandler.java:457)[184:org.openhab.binding.zwave:2.1.0]
	at org.openhab.binding.zwave.handler.ZWaveThingHandler.initialize(ZWaveThingHandler.java:150)[184:org.openhab.binding.zwave:2.1.0]
	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:192)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$7.call(ThingManager.java:528)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$7.call(ThingManager.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
	at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:181)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
	... 1 more

I’m getting the same error.

2017-11-27 14:59:08.172 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 58: Property to update: group_5, null, null
2017-11-27 14:59:08.172 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occurred while calling thing updated at Th
ingHandler 'org.openhab.binding.zwave.handler.ZWaveThingHandler@57590924': java.lang.NullPointerException
if (config.get(property).equals(originalConfig.get(property)) == false) {

Looks like the code already depends on Apache Commons Lang, so a possible fix would be:

import org.apache.commons.lang.StringUtils;

[...]

if (!StringUtils.equals(config.get(property), originalConfig.get(property))) {

I will fork and do a PR this evening if I get time.