openhab / openhab-distro

The binary distribution of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.3k stars 394 forks source link

Bundle com.sun.jna not active on RPI: is it normal ? #1557

Open lolodomo opened 1 year ago

lolodomo commented 1 year ago

After starting OH snapshot 3556, all bundles are active except one:

 40 x Starting x  80 x 5.12.1                 x com.sun.jna

Is there a problem somewhere ?

J-N-K commented 1 year ago

What does diag 40 say?

lolodomo commented 1 year ago

Nothing:

openhab> diag 40
openhab>
lolodomo commented 1 year ago

I probably did not check since a long time on my RPI but I have in mind that all the bundles were "Active" after a OH start.

lolodomo commented 1 year ago

I just tried to install the snapshot 3556 on my PC but with no config except the modules Basic UI and RRD4j and in that case, the bundle com.sun.jna is active. So maybe something specific to RPI or to my OH setup ?

lolodomo commented 1 year ago

@kaikreuzer : should we care of that or not for OH4 release ?

kaikreuzer commented 1 year ago

As we do not even know if there is a general problem and if so, how to fix it, I would clearly answer with "no".

wborn commented 1 year ago

Works fine on my Pi.

openhab> bundle:list -s | grep jna                                                                                      
 40 │ Active │  80 │ 5.12.1                 │ com.sun.jna
 41 │ Active │  80 │ 5.12.1                 │ com.sun.jna.platform
openhab> info
Karaf
  Karaf version               4.4.3
  Karaf home                  /openhab/runtime
  Karaf base                  /openhab/userdata
  OSGi Framework              org.eclipse.osgi-3.18.0.v20220516-2155

JVM
  Java Virtual Machine        OpenJDK 64-Bit Server VM version 17.0.7+7-Debian-1deb11u1
  Version                     17.0.7
  Vendor                      Debian
$ cat /proc/cpuinfo

...

Hardware    : BCM2835
Revision    : c03114
Model       : Raspberry Pi 4 Model B Rev 1.4
$ docker info

...

Server:
 Server Version: 24.0.5
 Kernel Version: 5.15.0-1032-raspi
 Operating System: Ubuntu 22.04.2 LTS
 OSType: linux
 Architecture: aarch64
lolodomo commented 1 year ago

Do you know what bundles are using this bundle ? Maybe my server setup doesn't need it ?

 40 x Starting x  80 x 5.12.1                 x com.sun.jna
 41 x Active   x  80 x 5.12.1                 x com.sun.jna.platform
Karaf
  Karaf version               4.4.3
  Karaf home                  /home/xxx/openhab/runtime
  Karaf base                  /home/xxx/openhab/userdata
  OSGi Framework              org.eclipse.osgi-3.18.0.v20220516-2155

JVM
  Java Virtual Machine        OpenJDK Server VM version 17.0.6+10
  Version                     17.0.6
  Vendor                      Azul Systems, Inc.

...

Operating system
  Name                        Linux version 5.10.103-v7+
  Architecture                arm
  Processors                  4
  Total physical memory       945,364 kbytes
  Free physical memory        88,288 kbytes
Model           : Raspberry Pi 3 Model B Plus Rev 1.3
wborn commented 1 year ago
openhab> bundle:capabilities 40
com.sun.jna_5.12.1 [40] provides:
---------------------------------
osgi.wiring.bundle; com.sun.jna 5.12.1 required by:
   com.sun.jna.platform_5.12.1 [41]
osgi.wiring.host; com.sun.jna 5.12.1 [UNUSED]
osgi.identity; com.sun.jna 5.12.1 [UNUSED]
osgi.wiring.package; com.sun.jna 5.12.1 required by:
   io.methvin.directory-watcher_0.17.1 [44]
   org.jline_3.21.0 [26]
osgi.wiring.package; com.sun.jna.ptr 5.12.1 required by:
   io.methvin.directory-watcher_0.17.1 [44]
   org.jline_3.21.0 [26]
osgi.wiring.package; com.sun.jna.win32 5.12.1 required by:
   org.jline_3.21.0 [26]

JNA is used for using native libraries which can improve performance. It could be there are no native libs for your architecture so it's not used.

See also: https://github.com/java-native-access/jna

I also have a Pi 3 with a 32-bit OS in storage which I can fire up to do some testing if I find some time.

org.jline

It's a Karaf dependency that deals with handling console input, see: https://github.com/jline/jline3

io.methvin.directory-watcher

This is used for the WatchService, see https://github.com/openhab/openhab-core/pull/3004.

wborn commented 1 year ago

Works fine on my old Pi too:

openhab> bundle:list -s | grep jna
 40 │ Active │  80 │ 5.12.1                 │ com.sun.jna
 41 │ Active │  80 │ 5.12.1                 │ com.sun.jna.platform
$ cat /proc/cpuinfo

...

Hardware    : BCM2835
Revision    : a02082
Model       : Raspberry Pi 3 Model B Rev 1.2
$ docker info

...

Server:
 Server Version: 24.0.5
 Kernel Version: 6.1.21-v7+
 Operating System: Raspbian GNU/Linux 11 (bullseye)
 OSType: linux
 Architecture: armv7l