Open alexf2015 opened 5 years ago
It would make sense store the returned reference of cachedResults.get(source)
to a local variable first and return immediately if null
has been returned. Otherwise continue calling iterator()
on that local variable...
Can you come up with a PR?
But perhaps it should be first analyzed why thingRemoved
is called with a not known discovery service.
But perhaps it should be first analyzed why
thingRemoved
is called with a not known discovery service.
As this is caused by the digitalstrom binding it would perhaps a good idea to involve one of the digitalstrom developers here.
Some more details from my side:
2019-01-18 09:45:25.667 [ERROR] [g.discovery.AbstractDiscoveryService] - An error occurred while calling the discovery listener org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.
java.lang.NullPointerException: null
...
2019-01-18 09:45:27.351 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx1' to inbox.
2019-01-18 09:45:27.368 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx2' to inbox.
2019-01-18 09:45:27.384 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx3' to inbox.
2019-01-18 09:45:27.399 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx4' to inbox.
2019-01-18 09:45:27.413 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx5' to inbox.
2019-01-18 09:45:27.434 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx6' to inbox.
2019-01-18 09:45:27.449 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx7' to inbox.
2019-01-18 09:45:27.465 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx8' to inbox.
2019-01-18 09:45:27.480 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'digitalstrom:GR:kasi:xxxxxx9' to inbox.
I am getting a similiar error but for the mqtt binding. Can't get the connection between mosquitto and openhab2 up and running.
2019-01-28 22:27:55.345 [ERROR] [g.discovery.AbstractDiscoveryService] - An error occurred while calling the discovery listener org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.java.lang.NullPointerException: null at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.thingRemoved(DiscoveryServiceRegistryImpl.java:278) ~[?:?] at org.eclipse.smarthome.config.discovery.AbstractDiscoveryService.thingRemoved(AbstractDiscoveryService.java:300) ~[?:?] at org.eclipse.smarthome.binding.mqtt.generic.internal.discovery.HomeAssistantDiscovery.receivedMessage(HomeAssistantDiscovery.java:164) ~[?:?] at org.eclipse.smarthome.binding.mqtt.discovery.TopicSubscribe.processMessage(TopicSubscribe.java:52) ~[?:?] at org.eclipse.smarthome.io.transport.mqtt.internal.ClientCallback.lambda$3(ClientCallback.java:90) ~[?:?] at java.util.ArrayList.forEach(ArrayList.java:1257) [?:?] at org.eclipse.smarthome.io.transport.mqtt.internal.ClientCallback.messageArrived(ClientCallback.java:90) [237:org.eclipse.smarthome.io.transport.mqtt:0.10.0.oh240] at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:499) [233:org.eclipse.paho.client.mqttv3:1.2.0] at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:402) [233:org.eclipse.paho.client.mqttv3:1.2.0] at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:206) [233:org.eclipse.paho.client.mqttv3:1.2.0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?] at java.lang.Thread.run(Thread.java:748) [?:?]
Since installation of openhab 2.4.0 and reactivation of the digitalstrom binding my log is flooded with messages like this: