[Solved] Task java.util.concurrent.ScheduledThreadPoolExecutor ScheduledFutureTask Not completed.. errors

The last week, I have started seeing this error on different things. Has anyone a clue what is wrong with my setup? I’m on 3.1 and I can’t remember doing anything special with my box lately. Or maybe they have always been there since I upgraded to 3.1 last month, and I have just not seen them…
Example below shows one node on zwave, and weatherflow just following each other.

First I thought it had something to do with rules, but now I don’t think so anymore, since it seems to happen on things also without rules. So maybe some resource issue?

Any suggestions welcome! :thinking:


10:34:27.985 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'GF_Corridor_Light2' changed from ON to OFF
10:34:27.986 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.zwave.handler.ZWaveThingHandler@3deb46c5': Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@3491f32a[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@6bf7154c[Wrapped task = org.openhab.binding.zwave.handler.ZWaveThingHandler$1@2ef59656]] rejected from org.openhab.core.internal.common.WrappedScheduledExecutorService@49581c3e[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 560]
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@3491f32a[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@6bf7154c[Wrapped task = org.openhab.binding.zwave.handler.ZWaveThingHandler$1@2ef59656]] rejected from org.openhab.core.internal.common.WrappedScheduledExecutorService@49581c3e[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 560]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(Unknown Source) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.reject(Unknown Source) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(Unknown Source) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(Unknown Source) ~[?:?]
        at org.openhab.binding.zwave.handler.ZWaveThingHandler.startPolling(ZWaveThingHandler.java:459) ~[?:?]
        at org.openhab.binding.zwave.handler.ZWaveThingHandler.handleCommand(ZWaveThingHandler.java:1220) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor165.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
        at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
        at com.sun.proxy.$Proxy4732.handleCommand(Unknown Source) [?:?]
        at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
        at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
        at jdk.internal.reflect.GeneratedMethodAccessor164.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
        at java.lang.Thread.run(Unknown Source) [?:?]
10:34:29.047 [WARN ] [eatherflowsmartweather.util.UdpServer] - UdpServer.Listener org.openhab.binding.weatherflowsmartweather.internal.SmartWeatherUDPListenerServiceImpl$1@3357cac6 threw an exception: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@675375b7[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@4ffbdfda[Wrapped task = org.openhab.binding.weatherflowsmartweather.handler.SmartWeatherTempestHandler$1@128f46a5]] rejected from org.openhab.core.internal.common.WrappedScheduledExecutorService@49581c3e[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 560]

This is on;
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

So I searched and found that other people with this issue solved it by restarting their servers, so I did just that, and it worked. Go figure.

1 Like

Hi,
i started having this issue today with kodi binding (kodi thing fails) and only openhab service restart helped. but then it happened again after 1 hour.

the error actually pops up in GUI when you disable enable a thing. thing looks ONLINE even though it doesnt work, so when you toggle it, it goes to COMMUNICATION_ERROR and prints the message below:

Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@14961f3[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@72279b[Wrapped task = org.openhab.binding.kodi.internal.handler.KodiHandler$$Lambda$1134/0x5b052e28@358390]] rejected from org.openhab.core.internal.common.WrappedScheduledExecutorService@d522eb[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 14251]

So, did you try to restart your entire machine (server), not just oh (service).

yes reboot of the machine helped.

Hey guys,
hope this bug will get fixed, it’s not so convenient to reboot entire server when this error happens. OH2.5 could run stable for months without restart, but with this java issue i have to reboot every few weeks…
anyone else with this kind of issues?

edit: I see the original poster uses openJDK same as me. not the same version but still almost same…
openjdk 11.0.12 2021-07-20 LTS
OpenJDK Runtime Environment Zulu11.50+19-CA (build 11.0.12+7-LTS)
OpenJDK Client VM Zulu11.50+19-CA (build 11.0.12+7-LTS, mixed mode)

is this java bug or openhab bug?

what do you suggest to do, should I try to upgrade java JDK?
or move away from openJDK to some other flavor of java, if other people don’t see this issue…

thanks

It’s probably a bug in an add-on that is shutting down a shared thread pool when you uninstall it or remove a Thing. What add-ons do you use?

See also:

thanks for the link!
yes i use miio (xiaomi) binding mentioned in your link and i might actually correlate the timing possibly while adding/removing things in there.
first i got a vaccum robot, first issue might have happened around that time, after a month it broke down so i got a replacement unit, deleted the old one, added new thing and java issue again (kodi addon stopped working and other random things (commands dont get executed via exec binding etc…)

I am done working on miio for now, i hope only to use the items without any changes…
so I will pay attention and monitor it.

Then you won’t have to do anything, except for maybe upgrade to 3.2.0.M3 that has the fix. :slight_smile:

I also am using miio binding, so that would explain it for me as well. Thanks for the heads up!

Had the same issue with MIIO also! So is it a MIIO issue ? Is there an update/beta/dev version of MIIO binding, where can I find it ? Thanks !