NPE in ModuleHook#shutdown with custom OPC-UA driver

Hey,
i just refactored my driver for the API change in 7.6.4 and am now (with 7.6.6) getting a NPE during shutdown. Does someone know, what node the device manager tries to unregister here? As far as i can tell, there should be no nodes left at this point, because i remove them during the shutdown of the driver instances.
I am quite sure this did not happen in 7.6.3 or before and i did not make any changes in this part of the code.

Thanks for your help,
Carsten

INFO   | jvm 1    | 2014/05/14 21:55:17 | ERROR [ModuleHook                    ] [21:55:16,938]: Error unregistering DriverType.
INFO   | jvm 1    | 2014/05/14 21:55:17 | java.lang.NullPointerException
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.inductiveautomation.xopc.server.addressspace.base.StandardNodeManager._removeNode(StandardNodeManager.java:129)
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.inductiveautomation.xopc.server.addressspace.base.StandardNodeManager.removeNode(StandardNodeManager.java:125)
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.inductiveautomation.xopc.server.addressspace.base.XOPCAddressSpace.updateDeviceFolder(XOPCAddressSpace.java:103)
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.inductiveautomation.xopc.server.devices.DeviceManager.unloadDriver(DeviceManager.java:220)
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.inductiveautomation.xopc.server.devices.DeviceManager.loadDriver(DeviceManager.java:179)
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.inductiveautomation.xopc.server.devices.DeviceManager.unregisterDriverType(DeviceManager.java:155)
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.inductiveautomation.xopc.driver.common.AbstractDriverModuleHook.shutdown(AbstractDriverModuleHook.java:78)
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.chitek.ignition.drivers.generictcp.ModuleHook.shutdown(ModuleHook.java:88)
INFO   | jvm 1    | 2014/05/14 21:55:17 | 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.shutdown(ModuleManagerImpl.java:2277)

Hmm, it’s trying to remove the folder for that device from under the Devices folder (the “[your-device-name]” folder) and for some reason it’s not finding it…

Is there a chance your driver is removing that folder as well? I can’t get this error to happen on my side.

Thanks for this information. It was a configuration issue on my side, the root cause was a folder node with an empty name that was added to the NodeManager. I assume that this folder replaced the device folder.
Maybe the API should check this in NodeManager#buildAndAddNode.

But after fixing this, i found another little bug: The Exception is gone, but the device nodes are not removed. Even after the module is uninstalled, the device node is still visible to OPC clients. Also the driver classes are not unloaded. This happens also with the built in drivers (checked with the S7 driver).

Just the [device-name] folder doesn’t get removed from underneath the Devices folder? This only happens with your driver and not the other ones?

I’ll look into the loading/unloading issue.

Just the [device-name] folder doesn't get removed from underneath the Devices folder? This only happens with your driver and not the other ones?

This happens also with the S7 driver. To reproduce, simply uninstall the module while a device is active.