NullPointerException in ZWaveNode.setAssociation(


I have 6 Fibaro FGD Dimmer 2 devices. Recently, I hard-resetted the controller and included all of them again. Before the reset they were all working, but now they all are stuck in the state SET_ASSOCIATION and the following exception is logged:

        at org.openhab.binding.zwave.internal.protocol.ZWaveNode.setAssociation([217:org.openhab.binding.zwave:]
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.advanceNodeStage([217:org.openhab.binding.zwave:]
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.handleNodeQueue([217:org.openhab.binding.zwave:]
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.ZWaveIncomingEvent([217:org.openhab.binding.zwave:]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.notifyEventListeners([217:org.openhab.binding.zwave:]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingRequestMessage([217:org.openhab.binding.zwave:]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingMessage([217:org.openhab.binding.zwave:]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.access$7([217:org.openhab.binding.zwave:]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController$[217:org.openhab.binding.zwave:]

Is this a bug of the Zwave binding? I already tried to update the binding with Karaf and also updated Openhab 2.
The binding version is, does anyone have the same problem as me?

I’m running the same version and I’m not seeing the NPE. While I have some Fibaro devices in my network, I don’t have any of the Dimmers.

@chris will probably want to see the debug log preceding the NPE. If you haven’t put the binding into debug mode yet, I’d suggest you do that, then post the log here.

The problem only occured on my 6 Fibaro FGD-212 devices. I was investigating allot into this yesterday, because it was annoying me allot and I found out that the bug has been introduced recently 5 days ago in this commit (line has already been commented by me yesterday):

I uninstalled the shipped Z-Wave binding and jumped back 1 commit, compiled the binding myself and loaded it… and now it’s working again.

If you still need more debug log please give me a sign and I will load the official shipped binding again.

Yeah, I looked at that commit, and it wasn’t obvious (at least to me) why line 1032 would cause an NPE, since the code checks for group != null immediately before referencing it.

It’s unclear to me why this should NPE - as @mhilbush said, the code checks for null assignments . I would suggest to delete the XML file and see if it solves the problem - I’m far from sure that it will since I don’t see why it should NPE in the first place. If it doesn’t, please provide a log and I’ll have a look further.

If group.getProfile2() returns null, doesn’t the Integer comparison with 1 throw a NPE because you can’t unbox null?

Which XML do you mean, the one in /var/lib/openhab2/zwave?

By the way: I like the Openhab community, I will apply for foundation membership :stuck_out_tongue_closed_eyes:

1 Like

Yep. That’s it.

Having the same problem with my 3 new Fibaro Dimmer2.

Any workarounds, beside downgrading the binding?

Regards, S

not that I know of.
Here is my binding jar that works:

1 Like

I’ll try and look at this tonight or tomorrow morning.

1 Like

I can’t test this at the moment, but hopefully this will fix this problem.

1 Like

I haven’t reincluded any devices, but at the moment it seems to work, thanks chris!

This seems to work for me as well.