Hi Matthias,
Thanks for the explanation. I’m afraid, though, the issue is more complicated. I apologize for the long post – it’s many lines, but not so much readable text, mainly commands and messages.
I installed Elasticsearch from this package:
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.12.deb
It looks like it came with this file:
/usr/share/elasticsearch/lib/jna-4.4.0-1.jar
I set up the Java to (among the rest) with
-Djava.class.path=.:/usr/lib/arm-linux-gnueabihf/jni
-Djna.nosys=true
You can see the script on https://github.com/mc0re/raspberry-pi (take it with care and, if you want to follow it, with a lot of patience!).
When I managed to run the elasticsearch binary on the command line, I got the message I told you about:
--= cut =--
java.lang.Error:
There is an incompatible JNA native library installed on this system
Expected: 5.1.0
Found: 4.0.0
(at /var/lib/elasticsearch/tmp/jna3030289347622179073.tmp).
--= cut =--
Then I got the latest version from https://github.com/java-native-access/jna, and after a really long building process I did this:
$ cp dist/*.jar /usr/share/elasticsearch/lib/
And hid the original “4.4.0-1” JAR to avoid a “jar hell” message.
The error message changed the version:
--= cut =--
java.lang.Error:
There is an incompatible JNA native library installed on this system
Expected: 5.1.0
Found: 6.0.0
(at /var/lib/elasticsearch/tmp/jna3030289347622179073.tmp).
--= cut =--
My next step was to find, where the version is specified, and change it. That didn’t help a bit, the version in the Java file was reverted back.
So I checked the repository and found, when it was changed. And “5.1.0” was not among the changes. So I picked “5.2.1”.
With this setup the error message apparently changed:
--= cut =--
[2018-10-05T18:41:23,101][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [netserver-pi] fatal error in thread [main], exiting
java.lang.NoSuchMethodError: com.sun.jna.Native.loadLibrary(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
at org.elasticsearch.bootstrap.SystemCallFilter.<clinit>(SystemCallFilter.java:118) ~[elasticsearch-5.6.12.jar:5.6.12]
--= cut =--
I wonder where did that “loadLibrary” go, as Native class is still there.
Interestingly, your hint about “java -jar” produced the same result as the original version check.
root@netserver-pi:~# java -jar /usr/share/elasticsearch/lib/jna.jar
Exception in thread "main" java.lang.Error:
There is an incompatible JNA native library installed on this system
Expected: 5.2.1
Found: 4.0.0
/usr/java/packages/lib/arm:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib.
So, based on your explanation, I guess Elasticsearch comes with own JNA classes hardcoded to expect version 5.1.0 of the native part, but I only have 4.0.0.
Now I’m left with two questions:
Does anyone know the answers?
Regards,
Mikhail
Hi Matthias,
Thanks, the “nosys” version works.
--= cut =--
Java Native Access (JNA) API Version 4
Version: 4.5.2 (b0)
Native: 5.2.2 (74e8f8e397c43487738c5c1f1363498b)
Prefix: linux-arm
--= cut =--
But I have “nosys” defined in Elasticsearch’es jvm.options file. Apparently, it does not get propagated. How can I otherwise disable system directory lookup? Or delete some files?
Hi again,
One more thing appeared.
I copied the 4.5.2 JAR to the same location as the other JNA JARs, and hid the others. Starting Elasticsearch yielded the following error message. Does it ring a bell?
--= cut =--
[2018-10-05T19:08:18,247][WARN ][o.e.b.JNANatives ] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: 'arm' architecture unsupported
at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:266) ~[elasticsearch-5.6.12.jar:5.6.12]
--= cut =--
Thanks,
Mikhail
Hi,
Do you know where is this “seccomp” defined, so I can try and get the arm version?
Yes, I add “-Djna.nosys=true”.
Do you have any ides how I can update the native part of JNA?
Mikhail
From: Matthias Bläsing
Sent: 05 October 2018 20:04
To: jna-...@googlegroups.com
Subject: Re: Where can I find JNA version 5.1.0?
Am Freitag, den 05.10.2018, 19:12 +0200 schrieb Mikhail Nikitin:
--
Thanks a lot! Now it runs 😊
Now I only need to make it as a service and get Logstash upgraded to 6.4.2, then.
The differences are:
Thanks again!
Mikhail
From: Matthias Bläsing
Sent: 06 October 2018 22:05
To: jna-...@googlegroups.com
Subject: Re: Where can I find JNA version 5.1.0?
Hi Mikhail,
--