# OH Hangs on Shutdown

**URL:** <https://community.openhab.org/t/oh-hangs-on-shutdown/61215>\
**Category:** Runtime\
**Tags:** shutdown\
**Created:** [December 26, 2018, 9:17pm UTC](https://community.openhab.org/t/oh-hangs-on-shutdown/61215 "2018-12-26T21:17:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KidSquid](https://community.openhab.org/user_avatar/community.openhab.org/kidsquid/32/3985_2.png) [@KidSquid](https://community.openhab.org/u/KidSquid)\
**Post date:** [December 26, 2018, 9:17pm UTC](https://community.openhab.org/t/oh-hangs-on-shutdown/61215/1 "2018-12-26T21:17:22Z")

</div>

Happy Holidays All -

I’ve been running a 2.3 version of OH on Windows Server for quite some time now.  
One issue that I’ve been unable to diagnose is that the system will hang on shutdown 8 out of 10 times.

To elaborate:  
If I need to restart OH or the server, I will enter “logout” in the Karaf console and wait for the system to properly shutdown. My previous experience is this should take anywhere from 10-30 seconds to shutdown and then the CLI window would close. Now I can walk away for 5 minutes or so and the command window is still open - the only thing I can do is force close the window by clicking the red-X. Most of the time this works fine - sometimes it locks up something in the JAVA process which can only be cleared by a reboot.

I’d like to know where I can look to try and see what’s causing the hang. The log files show nothing out of the norm is there a better way to monitor the shutdown process?

Many thanks,

Squid

---

<div class="post-metadata">

**Author:** ![namraccr](https://community.openhab.org/user_avatar/community.openhab.org/namraccr/32/36484_2.png) [@namraccr](https://community.openhab.org/u/namraccr)\
**Post date:** [December 29, 2018, 12:29am UTC](https://community.openhab.org/t/oh-hangs-on-shutdown/61215/2 "2018-12-29T00:29:23Z")

</div>

Have you experimented with waiting a really long time to see if these “hangs” eventually actually shut down? (e.g. 10, 20, 30 minutes?)

Have you tried killing the java process instead of rebooting?

---

<div class="post-metadata">

**Author:** ![KidSquid](https://community.openhab.org/user_avatar/community.openhab.org/kidsquid/32/3985_2.png) [@KidSquid](https://community.openhab.org/u/KidSquid)\
**Post date:** [December 29, 2018, 6:51am UTC](https://community.openhab.org/t/oh-hangs-on-shutdown/61215/3 "2018-12-29T06:51:20Z")

</div>

> [@namraccr](#):
>
> Have you experimented with waiting a really long time to see if these “hangs” eventually actually shut down? (e.g. 10, 20, 30 minutes?)

I may have waited 10 minutes, but I can’t remember waiting longer.

> [@namraccr](#):
>
> Have you tried killing the java process instead of rebooting?

I do not reboot, I kill the process by closing the KARAF window on my Windows machine. Every once in a while closing the window does not fully kill off the process and I am forced to kill the JAVA process from the Task Manager.

---

<div class="post-metadata">

**Author:** ![KidSquid](https://community.openhab.org/user_avatar/community.openhab.org/kidsquid/32/3985_2.png) [@KidSquid](https://community.openhab.org/u/KidSquid)\
**Post date:** [December 31, 2018, 2:46am UTC](https://community.openhab.org/t/oh-hangs-on-shutdown/61215/4 "2018-12-31T02:46:12Z")

</div>

So while testing out an upgrade to 2.4 I shutdown OH and gave it a bunch of time for the KARAF window to close.

About 15 minutes later…I saw this printed in the KARAF window…it’s not in the log file.

```auto
java.lang.RuntimeException: Fatal error while executing protocol 'ReceivingNotification': java.lang.
NullPointerException
        at org.jupnp.protocol.ReceivingAsync.run(ReceivingAsync.java:75)
        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)
Caused by: java.lang.NullPointerException
        at org.jupnp.protocol.async.ReceivingNotification.execute(ReceivingNotification.java:122)
        at org.jupnp.protocol.ReceivingAsync.run(ReceivingAsync.java:69)
        ... 3 more
java.lang.RuntimeException: Fatal error while executing protocol 'SendingUnsubscribe': java.lang.Nul
lPointerException
        at org.jupnp.protocol.SendingAsync.run(SendingAsync.java:58)
        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)
Caused by: java.lang.NullPointerException
        at org.jupnp.protocol.sync.SendingUnsubscribe.onUnsubscribe(SendingUnsubscribe.java:72)
        at org.jupnp.protocol.sync.SendingUnsubscribe.executeSync(SendingUnsubscribe.java:64)
        at org.jupnp.protocol.SendingSync.execute(SendingSync.java:53)
        at org.jupnp.protocol.SendingAsync.run(SendingAsync.java:52)
        ... 3 more
java.lang.RuntimeException: Fatal error while executing protocol 'ReceivingNotification': java.lang.
NullPointerException
        at org.jupnp.protocol.ReceivingAsync.run(ReceivingAsync.java:75)
        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)
Caused by: java.lang.NullPointerException
        at org.jupnp.protocol.async.ReceivingNotification.execute(ReceivingNotification.java:122)
        at org.jupnp.protocol.ReceivingAsync.run(ReceivingAsync.java:69)
        ... 3 more

```

Any suggestions greatly appreciated.

Squid
