openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[bluetooth] NPE in ConnectedBluetoothHandler #6917

Closed cpmeister closed 7 months ago

cpmeister commented 4 years ago

Found exception in the logs when linking/unlinking items in the UI


2020-01-26 20:39:20.536 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 

java.lang.NullPointerException: null

    at org.openhab.binding.bluetooth.ConnectedBluetoothHandler.lambda$0(ConnectedBluetoothHandler.java:70) ~[?:?]

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_222]

    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:1.8.0_222]

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_222]

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_222]

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]

    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]```
cpmeister commented 4 years ago

Also got an endless bunch of these:

2020-01-26 20:39:25.604 [ERROR] [ab.binding.bluetooth.BluetoothDevice] - Failed to inform listener 'org.openhab.binding.bluetooth.am43.internal.AM43Handler@1147f0c': null

java.lang.NullPointerException: null

    at org.openhab.binding.bluetooth.BeaconBluetoothHandler.onScanRecordReceived(BeaconBluetoothHandler.java:147) ~[?:?]

    at org.openhab.binding.bluetooth.BluetoothDevice.notifyListeners(BluetoothDevice.java:507) ~[?:?]

    at org.openhab.binding.bluetooth.bluez.BlueZBluetoothDevice.lambda$3(BlueZBluetoothDevice.java:118) ~[?:?]

It appears as if a scheduled future wasn't canceled? Even though the code clearly indicates to cancel it...

lsiepel commented 1 year ago

I`m wondering if this is still an issue as it is three years old. I see several PR's since this issue and last week i tried to improve the null handling by PR: https://github.com/openhab/openhab-addons/pull/13979

If this is still an issue, could you verify if it is solved (or still happening) by those bluetooth PR's?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.