Problems initializing Systeminfo binding

  • Platform information:
    • Hardware: PINE64
    • openHAB version:2.4 M5
  • Java:
    • openjdk version “1.8.0_112”
    • OpenJDK Runtime Environment (Zulu Embedded 8.19.0.31-linux-aarch32hf) (build 1.8.0_112-b31)
    • OpenJDK Client VM (Zulu Embedded 8.19.0.31-linux-aarch32hf) (build 25.112-b31, mixed mode, Evaluation)

On a working Openhab2.4 I’m trying a (for me) new binding system info.
Systeminfo is installed.

systeminfo.things contains

systeminfo:computer:work [interval_high=3, interval_medium=60]

(as in the example from https://www.openhab.org/addons/bindings/systeminfo/#updating-this-binding )

When it launches I get

13:10:07.745 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model ‘systeminfo.things’

13:10:07.967 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘systeminfo:computer:work’ changed from UNINITIALIZED to INITIALIZING

13:10:08.050 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.initialize()’ on ‘org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler@1e3d8df’: Could not initialize class oshi.jna.platform.linux.Udev

java.lang.NoClassDefFoundError: Could not initialize class oshi.jna.platform.linux.Udev

at oshi.hardware.platform.linux.LinuxDisks.getDisks(LinuxDisks.java:67) ~[?:?]

at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getDiskStores(LinuxHardwareAbstractionLayer.java:82) ~[?:?]

at org.openhab.binding.systeminfo.internal.model.OshiSysteminfo.initializeSysteminfo(OshiSysteminfo.java:95) ~[?:?]

at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.instantiateSysteminfoLibrary(SysteminfoHandler.java:119) ~[?:?]

at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.initialize(SysteminfoHandler.java:105) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh240M5]

at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.oh240M5]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]

at java.lang.Thread.run(Thread.java:745) [?:?]

13:10:08.092 [ERROR] [.core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing ‘systeminfo:computer:work’: Could not initialize class oshi.jna.platform.linux.Udev

java.lang.NoClassDefFoundError: Could not initialize class oshi.jna.platform.linux.Udev

at oshi.hardware.platform.linux.LinuxDisks.getDisks(LinuxDisks.java:67) ~[?:?]

at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getDiskStores(LinuxHardwareAbstractionLayer.java:82) ~[?:?]

at org.openhab.binding.systeminfo.internal.model.OshiSysteminfo.initializeSysteminfo(OshiSysteminfo.java:95) ~[?:?]

at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.instantiateSysteminfoLibrary(SysteminfoHandler.java:119) ~[?:?]

at org.openhab.binding.systeminfo.internal.handler.SysteminfoHandler.initialize(SysteminfoHandler.java:105) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh240M5]

at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.oh240M5]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]

at java.lang.Thread.run(Thread.java:745) [?:?]

Have you checked if the versions of the OSHI dependencies such as jna and jna-platform are the correct version?

how do I do that? I saw some mentions on the binding page for jna, yet I have no idea what that is or how to check it.

Not sure at the moment, but you can try using the Karaf console. What version of OSHI are you using? I know that info can be found using Karaf.

1 Like

I had no idea you can do that.
So far on karaf I only look at the logging. (what I learned from https://www.openhab.org/docs/administration/logging.html#karaf-console)

I see there is something like bundle:list | grep openhab
(strangely I notice that noyt all openhab binding use the name openhab in it’s name. so not consistent. )

would that mean I can do bundle:list | grep OSHI ?

that gives nothing back.

Try the binding name, org.openhab.binding.systeminfo or use grep with systeminfo

oh but system info I see, that is 2.4.0.M5

If using 2.4 M5 then installing the binding via PaperUI should be all that’s needed. Have you check github to see if there has been a similar issue with OH 2.4 using systeminfo binding?

Here is the latest jar file I could find https://openhab.ci.cloudbees.com/job/openHAB2-Bundles/lastSuccessfulBuild/org.openhab.binding$org.openhab.binding.systeminfo/ I doubt it will make a difference but you can try uniinstalling via PaperUI and place the jar file in your addons folder.

The other option that has a better chance of working is to try a different OH 2.4 build.

I’m not using paperUI, I’m using addons/cfg yet that is the same.
no Info on github.

the chance is high it’s related to OSHI, yet no idea how to check

Using bundle:list | grep openhab should show everything installed and may show dependencies as well.

when I do that, I won’t see the system info binding as it’s using openHAB in it’s name.
When I do, I get only a list of a few things. Not their dependencies.

bundle:list | grep openHAB
179 ? Active ? 90 ? 2.4.0.M5 ? openHAB Core
180 ? Active ? 80 ? 2.4.0.M5 ? openHAB Karaf Integration
182 ? Resolved ? 80 ? 2.4.0.M5 ? openHAB Sound Support, Hosts: 115
183 ? Active ? 80 ? 2.4.0.M5 ? openHAB Dashboard UI
195 ? Active ? 80 ? 2.4.0.M5 ? openHAB 1.x Compatibility Layer
229 ? Active ? 80 ? 1.13.0.M5 ? openHAB Mail Action
230 ? Active ? 80 ? 1.13.0.M5 ? openHAB Anel Binding
233 ? Active ? 80 ? 1.13.0.M5 ? openHAB MQTT Binding
237 ? Active ? 80 ? 2.4.0.M5 ? openHAB Cloud Connector Bundle
238 ? Active ? 80 ? 2.4.0.M5 ? openHAB REST Documentation
239 ? Active ? 80 ? 1.13.0.M5 ? openHAB MQTT Transport Bundle
240 ? Active ? 80 ? 1.13.0.M5 ? openHAB InfluxDB Persistence bundle
241 ? Resolved ? 75 ? 2.4.0.M5 ? openHAB Basic UI Fragment, Hosts: 226
242 ? Resolved ? 75 ? 2.4.0.M5 ? openHAB Paper UI Theme Fragment, Hosts: 227