"OH-eventexecutor-1" java.lang.NullPointerException

As in Exception in thread "OH-eventexecutor-1" - #13 by james_2_roberts, out of the blue, my system started logging this NPE:

Jan  5 12:23:30 openhab karaf[31314]: Exception in thread "OH-eventexecutor-1" java.lang.NullPointerException
Jan  5 12:23:30 openhab karaf[31314]: Exception in thread "OH-eventexecutor-3" Exception in thread "OH-eventexecutor-2" #011at java.base/java.util.concurrent.LinkedBlockingQueue.dequeue(LinkedBlockingQueue.java:217)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.lang.Thread.run(Thread.java:829)
Jan  5 12:23:30 openhab karaf[31314]: java.lang.NullPointerException
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.LinkedBlockingQueue.dequeue(LinkedBlockingQueue.java:214)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.lang.Thread.run(Thread.java:829)
Jan  5 12:23:30 openhab karaf[31314]: java.lang.NullPointerException
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.LinkedBlockingQueue.dequeue(LinkedBlockingQueue.java:214)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.lang.Thread.run(Thread.java:829)
Jan  5 12:23:30 openhab karaf[31314]: Exception in thread "OH-eventexecutor-4" java.lang.NullPointerException
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.LinkedBlockingQueue.dequeue(LinkedBlockingQueue.java:214)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Jan  5 12:23:30 openhab karaf[31314]: #011at java.base/java.lang.Thread.run(Thread.java:829)

Nothing appears in kernel.log at that time. A service restart solved the situation.

  • Platform information:
    • Hardware: Raspberry Pi CM4 8G emmc 32G
    • OS: Rasbian 11
    • Java Runtime Environment:
      openjdk version “11.0.13” 2021-10-19 LTS
      OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS)
      OpenJDK Client VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)
    • openHAB version: 3.2.0

This is not the first time this happens. A few days ago something similar happened and the logs filled up the entire file system.

Any ideas?

Same as this Syslog Errors (100 GB)

I switched to AdoptOpenJDK and the issues stopped.

On Raspbian?

Yes, raspbian.

Just in case someone needs it, I followed these steps:

$ wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
$ echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb bullseye main" | sudo tee 
$ sudo apt update
$ sudo apt install adoptopenjdk-11-hotspot

The java alternatives are set as so:

$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                                          Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/adoptopenjdk-11-hotspot-armhf/bin/java            1111      auto mode
  1            /opt/jdk/zulu11.52.13-ca-jdk11.0.13-linux_aarch32hf/bin/java   1         manual mode
  2            /usr/lib/jvm/adoptopenjdk-11-hotspot-armhf/bin/java            1111      manual mode

Press <enter> to keep the current choice[*], or type selection number:

Restart service and openhab should start using the new jdk.

Let’s see if the issue goes away…

2 Likes