Org.elasticsearch.bootstrap - JNA not found. native methods will be disabled

Hi everybody

org.elasticsearch.bootstrap - JNA not found. native methods will be disabled.

is the message i get. My es-cluster (1.7.2) is fully embedded.
libjna-java are installed (Ubuntu).
Is there a path or an env variable to set or an
.settings(ImmutableSettings.settingsBuilder()
.put("jna....whatever", somewhere) to use ?

Thank you.

If you run embedded, you need jna jar on the classpath.

3 Likes

Arrrrr. It was not in my fat jar !
It works. Thanks.

  1. On 1.7.0, there is no long stacktrace reported. Is it expected that 2.0.0-beta has different reporting ?

  2. if jna.jar is required, should'it be in the maven dependencies ?

You can git clone https://github.com/ltregan/esregression then run "mvn test -Dtest=AppTest".

Here is the stack trace with 2.0.0-beta. It runs clean on 1.7.0.

You can try WARNING: JNA not found. native methods will be disabled.
java.lang.ClassNotFoundException: com.sun.jna.Native
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.elasticsearch.bootstrap.Natives.(Natives.java:43)
at org.elasticsearch.bootstrap.BootstrapInfo.isMemoryLocked(BootstrapInf
o.java:44)
at org.elasticsearch.monitor.process.ProcessProbe.processInfo(ProcessPro
be.java:139)
at org.elasticsearch.monitor.process.ProcessService.(ProcessServic

    <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <version>4.1.0</version>
    </dependency>

works for me with 1.7.2 and java jna lib install on ubuntu.

JNA is optional so that ES can be tested without mlockall or other native features.

The long stacktrace is new in 2.0 and there are different opinions about it but JNA is also really optional when using ES as client and not as a server, so the stacktrace may help to diagnose situations whether JNA is really required or not https://github.com/elastic/elasticsearch/issues/13245

ok, thanks for the pointer to the issue !

Thanks, this works perfectly. It's really annoying to keep getting those error messages.

thanks for contributing!