[SOLVED] Problem with windcentrale binding

Hi all,

I have a rather new openhab2.4 setup on ubuntu 18.04 with java openjdk version “11.0.4” 2019-07-16.
Amongst other bindings i installed the windcentrale binding. That works as expected, except… It gives after a couple of hours working an exception, and then it stops working…

The exception is as follows:

> 2019-09-12 16:47:17.624 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
> java.lang.ClassCastException: class com.google.gson.JsonNull cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonNull and com.google.gson.JsonObject are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4079f006)
>         at org.openhab.binding.windcentrale.internal.handler.WindcentraleHandler.updateData(WindcentraleHandler.java:125) ~[?:?]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
>         at java.lang.Thread.run(Thread.java:834) [?:?]

I can restart the binding with the command
ssh openhab@localhost -p8101 ‘bundle:restart org.openhab.binding.windcentrale’
But thats not the solution i was looking for…

Looks like it can’t handle certain data. Maybe it returns incomplete data that can’t be parsed. Unfortunately the log that prints the value returned is after the code that crashes. Can you file a bug report on openHAB2-addons.on GitHub.

Does it also occur with Java 8? That’s the recommended Java version, see the requirements.

1 Like

Hi Wouter,

After reading your comment i tried to install Java 8, but the oracle apt store is not available anymore…
So i installed the ZULU java implementation, en configured this as the default java.
Since i did this, the error did not occur anymore, so that seems the be the problem/solution.


Nice that it now works! Meanwhile there was also a PR by @hilbrand which should improve exception handling:

It’s available in the recent 2.5.0-SNAPSHOT builds.

1 Like