Skip to content

Win10: JNA can't find dependent libraries #10737

@amotl

Description

@amotl

CrateDB version:
4.3.1

Environment description:

$ systeminfo /fo csv | ConvertFrom-Csv | select OS*, System*, Hotfix* | Format-List

OS Name             : Microsoft Windows 10 Enterprise Evaluation
OS Version          : 10.0.17763 N/A Build 17763
OS Manufacturer     : Microsoft Corporation
OS Configuration    : Standalone Workstation
OS Build Type       : Multiprocessor Free
System Boot Time    : 11/3/2020, 10:12:48 AM
System Manufacturer : innotek GmbH
System Model        : VirtualBox
System Type         : x64-based PC
System Directory    : C:\Windows\system32
System Locale       : en-us;English (United States)
Hotfix(s)           : 6 Hotfix(s) Installed.,[01]: KB4486553,[02]: KB4462930,[03]: KB4470788,[04]: KB4480056,[05]:
                      KB4489907,[06]: KB4489899

Problem description:
Dear CrateDB developers,

while working on crate/crate-python#388, I tried to give CrateDB a manual testdrive on a VirtualBox machine. While it started up successfully, it warned about not being able to load the JNA native support library.

While I don't know about any possible implications of that, I found java-native-access/jna#636, MarkusBernhardt/proxy-vole#35 and qzind/tray#413, followed by the apparent fix to just bump the JNA version to 4.5.2 the other day, see qzind/tray#427.

So, we might also bump the version and see what we might gain from that?

After manually replacing jna-4.2.2.jar by jna-5.6.0.jar downloaded from [1] within C:\Users\IEUser\develop\crate-4.3.1\lib, the warning outlined below goes away. So, unless #10738 doesn't break anything for other platforms, it might be considered sane.

With kind regards,
Andreas.

[1] https://download.jar-download.com/cache_jars/net.java.dev.jna/jna/5.6.0/jar_files.zip

PS C:\Users\IEUser\develop\crate-4.3.1> .\bin\crate.bat
[2020-11-03T10:46:04,124][WARN ][o.e.b.Natives            ] [Hochrettelstein] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: C:\Users\IEUser\AppData\Local\Temp\jna--2138670329\jna12589025790167177108.dll: Can't find dependent libraries
        at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
        at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383) ~[?:?]
        at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227) ~[?:?]
        at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169) ~[?:?]
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2407) ~[?:?]
        at java.lang.Runtime.load0(Runtime.java:747) ~[?:?]
        at java.lang.System.load(System.java:1857) ~[?:?]
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851) ~[jna-4.2.2.jar:4.2.2 (b0)]
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826) ~[jna-4.2.2.jar:4.2.2 (b0)]
        at com.sun.jna.Native.<clinit>(Native.java:140) ~[jna-4.2.2.jar:4.2.2 (b0)]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:377) ~[?:?]
        at org.elasticsearch.bootstrap.Natives.<clinit>(Natives.java:45) [crate-app.jar:4.3.1]
        at org.elasticsearch.bootstrap.BootstrapProxy.initializeNatives(BootstrapProxy.java:103) [crate-app.jar:4.3.1]
        at org.elasticsearch.bootstrap.BootstrapProxy.setup(BootstrapProxy.java:156) [crate-app.jar:4.3.1]
        at org.elasticsearch.bootstrap.BootstrapProxy.init(BootstrapProxy.java:267) [crate-app.jar:4.3.1]
        at io.crate.bootstrap.CrateDB.init(CrateDB.java:158) [crate-app.jar:4.3.1]
        at io.crate.bootstrap.CrateDB.execute(CrateDB.java:138) [crate-app.jar:4.3.1]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:82) [crate-app.jar:4.3.1]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [crate-app.jar:4.3.1]
        at org.elasticsearch.cli.Command.main(Command.java:90) [crate-app.jar:4.3.1]
        at io.crate.bootstrap.CrateDB.main(CrateDB.java:91) [crate-app.jar:4.3.1]
        at io.crate.bootstrap.CrateDB.main(CrateDB.java:84) [crate-app.jar:4.3.1]
[2020-11-03T10:46:04,140][WARN ][o.e.b.Natives            ] [Hochrettelstein] cannot check if running as root because JNA is not available
[2020-11-03T10:46:04,155][WARN ][o.e.b.Natives            ] [Hochrettelstein] cannot register console handler because JNA is not available
[2020-11-03T10:46:04,155][WARN ][o.e.b.JNAKernel32Library ] [Hochrettelstein] JNA not found. native methods and handlers will be disabled.
[2020-11-03T10:46:04,155][WARN ][o.e.b.Natives            ] [Hochrettelstein] cannot getrlimit RLIMIT_NPROC because JNA is not available
[2020-11-03T10:46:04,155][WARN ][o.e.b.Natives            ] [Hochrettelstein] cannot getrlimit RLIMIT_AS because JNA is not available
[2020-11-03T10:46:04,155][WARN ][o.e.b.Natives            ] [Hochrettelstein] cannot getrlimit RLIMIT_FSIZE because JNA is not available
[2020-11-03T10:46:04,499][INFO ][o.e.e.NodeEnvironment    ] [Hochrettelstein] using [1] data paths, mounts [[Windows 10 (C:)]], net usable_space [20.7gb], net total_space [39.9gb], types [NTFS]
[2020-11-03T10:46:04,499][INFO ][o.e.e.NodeEnvironment    ] [Hochrettelstein] heap size [1gb], compressed ordinary object pointers [true]
[2020-11-03T10:46:04,499][INFO ][o.e.n.Node               ] [Hochrettelstein] node name [Hochrettelstein], node ID [T-_c8KSHTamqjFnCEJA_hQ]
[2020-11-03T10:46:04,546][INFO ][o.e.n.Node               ] [Hochrettelstein] version[4.3.1], pid[8100], build[fb0b9b2/2020-10-29T09:40:54Z], OS[Windows 10/10.0/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/15.0.1/15.0.1+9]
[2020-11-03T10:46:05,125][INFO ][i.c.plugin               ] [Hochrettelstein] plugins loaded: [enterpriseFunctions, jmx-monitoring, lang-js]
[...]

Steps to reproduce:

  • Install VirtualBox: brew install virtualbox
  • Download and unpack image "MSEdge on Win10 (x64) Stable 1809" from [1]
  • Import image MSEdge - Win10.ovf into VirtualBox and spin up virtual machine
  • Download and unpack CrateDB for Windows from [2]
  • Run PowerShell with Administrator permissions
  • cd C:\Users\IEUser\develop\crate-4.3.1
  • Invoke .\bin\crate.bat

P.S.: In order to get hold of a complete development environment for Windows 10, see [3]. However, this weighs in with ~20GB while [2] just has ~7GB ;].

[1] https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
[2] https://cdn.crate.io/downloads/releases/cratedb/x64_windows/crate-4.3.1.zip
[3] https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement that doesn't fit into a more specific feature label. Try avoid using thisplatform: windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions