Comment 13 for bug 1662813

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

I installed jenkins 2.138.1 from http://pkg.jenkins.io/debian-stable and while I was unable to reproduce the issue. I looked at its structure and found out that they package their own jna.jar with its own libjnidispatch.so libraries inside.

Their jna jar file is located at ./WEB-INF/lib/jna-4.5.2.jar inside the jenkins.war file. The jna-4.5.2.jar contains libraries for quite a few classes, including com/sun/jna/linux-s390x/libjnidispatch.so.

This means that one is not required to install libjna-java as jenkins is expected to use its own jna jar file.

That said, in order to debug why loading is failing you can update the JAVA_ARGS in /etc/default/jenkins to
# Allow graphs etc. to work even when an X server is present
JAVA_ARGS="-Djava.awt.headless=true -Djna.debug_load.jna=true -Djna.debug_load=true -XshowSettings"

Then follow these steps:
1. restart jenkins (/etc/init.d/jenkins restart)
2. login into the web interface
3. look for "jni" and "jnidispatch" in /var/log/jenkins/jenkins.log

In my case the output was:
Trying (via loadLibrary) jnidispatch
Looking in classpath from WebAppClassLoader=Jenkins v2.138.1@2a2d45ba for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/var/cache/jenkins/war/WEB-INF/lib/jna-4.5.2.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Trying /tmp/jna--1712433994/jna5981117083713165017.tmp
Found jnidispatch at /tmp/jna--1712433994/jna5981117083713165017.tmp

Which means that, even with the libjna-java/libjna-jni installed, it is still loading jna's internal classes and libraries from the jenkins war file. I did re-test with libjna-java/libjna-jni uninstalled and the results are - as expected - the same.

Take a look at the jenkins log and check what your system is trying to do. The log should also contain various java properties (due to the -XshowSettings argument), so you can look and check whether any of the jna properties are being overridden.

For completion's sake here are my results from the provided test case:

> After installation and initial configuration the url
> http://xxx:8080/restart

After installing jenkins deb I accessed its web interface at port :8080, used the first time password (as indicated by the log), selected the default configuration/plugins (test case was not clear as to what option I should use), waited for it to finish installation, got asked to configure a user, then got logged in as admin. There was never a request to restart jenkins nor a indication from jenkins that I should it.

Just in case, I used the :8080/restart and it successfully restarted jenkins.

> will give the following message:
> Jenkins cannot restart itself as currently configured.

After restart there were no similar messages in either the logs or the web interface.

Two points that are not clear whether they are the same as they were not explicitly informed in the test case:
- the jenkins version being used, as a different version might pack some other jna or configure it differently
- the configuration selected in the web interface, as installing different plugins might cause some other issue to pop-up (eg. plugin packs its own jna, overrides some configuration, etc).