NullPointerException in ZWaveNode.setAssociation(ZWaveNode.java:1032)

Hey,

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:

java.lang.NullPointerException
        at org.openhab.binding.zwave.internal.protocol.ZWaveNode.setAssociation(ZWaveNode.java:1032)[217:org.openhab.binding.zwave:2.0.0.201701091302]
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.advanceNodeStage(ZWaveNodeInitStageAdvancer.java:921)[217:org.openhab.binding.zwave:2.0.0.201701091302]
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.handleNodeQueue(ZWaveNodeInitStageAdvancer.java:230)[217:org.openhab.binding.zwave:2.0.0.201701091302]
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.ZWaveIncomingEvent(ZWaveNodeInitStageAdvancer.java:1306)[217:org.openhab.binding.zwave:2.0.0.201701091302]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.notifyEventListeners(ZWaveController.java:567)[217:org.openhab.binding.zwave:2.0.0.201701091302]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingRequestMessage(ZWaveController.java:250)[217:org.openhab.binding.zwave:2.0.0.201701091302]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingMessage(ZWaveController.java:214)[217:org.openhab.binding.zwave:2.0.0.201701091302]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.access$7(ZWaveController.java:208)[217:org.openhab.binding.zwave:2.0.0.201701091302]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController$ZWaveInputThread.run(ZWaveController.java:1324)[217:org.openhab.binding.zwave:2.0.0.201701091302]

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 2.0.0.201701091302, 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: https://drive.google.com/open?id=0B8bLcexp23XKMFl3Y2VBQnQ2Umc

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!

@chris
This seems to work for me as well.