Project

General

Profile

Bug #830

Building from source fails: Error: Module java.logging not found, required by org.openecard.richclient

Added by Theo Wollenleben 3 months ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/25/2021
Due date:
% Done:

0%

Estimated time:
Reviewer:
Build Version:

Description

OS: Linux (openSUSE Tumbleweed) with OpenJDK 14 and higher

I have no success trying to build Open eCard from source. Following the build instructions

$ git clone git://github.com/ecsec/open-ecard.git
$ cd open-ecard
$ mvn clean install

gives the following error:
[ERROR] Error: Module java.logging not found, required by org.openecard.richclient
[ERROR] java.lang.module.FindException: Module java.logging not found, required by org.openecard.richclient
[ERROR]         at java.base/java.lang.module.Resolver.findFail(Resolver.java:900)
[ERROR]         at java.base/java.lang.module.Resolver.resolve(Resolver.java:191)
[ERROR]         at java.base/java.lang.module.Resolver.resolve(Resolver.java:140)
[ERROR]         at java.base/java.lang.module.Configuration.resolve(Configuration.java:421)
[ERROR]         at java.base/java.lang.module.Configuration.resolve(Configuration.java:255)
[ERROR]         at jdk.jlink/jdk.tools.jlink.internal.Jlink$JlinkConfiguration.resolve(Jlink.java:217)
[ERROR]         at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImageProvider(JlinkTask.java:489)
[ERROR]         at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImage(JlinkTask.java:399)
[ERROR]         at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:271)
[ERROR]         at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:54)
[ERROR]         at jdk.jlink/jdk.tools.jlink.internal.Main.main(Main.java:33)
[ERROR] Failed to execute goal net.agilhard.maven.plugins:jlink-jpackager-maven-plugin:1.0.0-ec.4:jlink (jlink) on project richclient-packager: 
[ERROR] Exit code: 1
[ERROR] Command line was: /bin/sh -c /usr/lib64/jvm/java/bin/jlink @/usr/src/git/open-ecard/packager/richclient-packager/target/jlinkArgs

The reported missing module seems to be present:
$ java --list-modules | grep java.logging
java.logging@11.0.7

Resuming with
$ mvn clean install -rf :richclient-packager

leads to more allegedly missing modules (java.base, java.desktop, ...).


Files

open-ecard-jdk-12.0.2-debugfonts.log (8.59 KB) open-ecard-jdk-12.0.2-debugfonts.log Java log for version 12.0.2 Theo Wollenleben, 07/08/2021 03:15 AM
open-ecard-jdk-13-debugfonts-abridged.log (310 KB) open-ecard-jdk-13-debugfonts-abridged.log Java log abridged for version 13 Theo Wollenleben, 07/08/2021 03:15 AM

History

#1

Updated by Florian Otto 3 months ago

Thanks for reporting.

I unfortunately cannot reproduce this bahaviour.
I assume problems in a combination of versions maven, java, jdks.

There are min versions and enforcers defined in maven, but it seems they don't cover all combinations.
However, we plan to upgrade the desktop variants to version 2 soon.
Then the packaging will be rewritten anyway.

On my setup i have

$ mvn --version:
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 12.0.2, vendor: Debian, runtime: /usr/lib/jvm/java-12-openjdk-amd64
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "5.10.0-8-amd64", arch: "amd64", family: "unix"

$ update-alternatives --list java:
/usr/lib/jvm/java-10-openjdk-amd64/bin/java
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
/usr/lib/jvm/java-12-openjdk-amd64/bin/java
/usr/lib/jvm/java-14-openjdk-amd64/bin/java
/usr/lib/jvm/java-17-openjdk-amd64/bin/java
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
/usr/lib/jvm/java-9-openjdk-amd64/bin/java

With this i can build the project with
$mvn clean install -pl '!clients/android-lib'
android-lib is broken currently, but mobile versions are allready covered by version 2, so it won't be fixed.

Hope this helps.

#2

Updated by Theo Wollenleben 3 months ago

I can build the project with the JDKs from Oracle (https://jdk.java.net/). Maybe there is something wrong with openSUSE's JDKs.

I noticed that starting my own build or the app from the official RPMs takes much longer than starting the bundled test build from https://files.ecsec.de/index.php/s/2jDmibFgacwMtQc (see #829#note-8). This is the same for Oracle's and openSUSE's runtime environments and can take more than a minute on my (old) computer before the app is ready after reading hundreds of megabytes from my hard disk. The test build is ready after a few seconds.

#3

Updated by Florian Otto 3 months ago

I honestly cannot explain this effect.
However, the runtime environments should have no effect, since java is contained in the bundle.

#4

Updated by Theo Wollenleben 3 months ago

Theo Wollenleben wrote:

I noticed that starting my own build or the app from the official RPMs takes much longer than starting the bundled test build

This depends on the version of OpenJDK used to build the project. The app starts quickly with version 12.0.2 from https://jdk.java.net/archive/, with version 13 GA and later it takes a lot of time because Java is reading font files on my system on every start. When tracing system calls, I can see that Java 12 only reads files called '.uuid' in the system's font directories, while Java 13 also reads all the font files *.pfb, *.otf, *.ttf, ..., which is hundreds of megabytes.

(Another, maybe irrelevant, thing I see for Java 13 is a huge number of "EINVAL (Invalid argument)" errors from 'readlink' system calls, producing almost 95% of traced calls.)

I don't know who to blame here, openSUSE, OpenJDK, or Open eCard, but in case anyone is interested, I also append logging output from the app (abridged for Java 13, which would be over 90 MB) and provide details how I diagnosed the problem. I used commands of the following form to trace file access system calls:

LC_ALL=C strace -f -t -e trace=access,newfstatat,openat,readlink /opt/open-ecard/bin/open-ecard > strace.log

This is less than one megabyte output for version 12.0.2, more than 40 MB for version 13 because of all the EINVAL errors. A sorted list of files accessed by the app can be obtained with

grep -o '"/[^"]*"' strace.log | sort | uniq

For the Java log, I included the following command line parameters before '-m org.openecard.richclient/org.openecard.richclient.RichClient' in '/opt/open-ecard/bin/open-ecard':

-Dsun.java2d.debugfonts=true -Djava.util.logging.SimpleFormatter.format='%4$s [%2$s] %5$s%6$s%n'

and created the file '/opt/open-ecard/lib/logging.properties' with the content

java.util.logging.ConsoleHandler.level = ALL
sun.awt.FontConfiguration.level = ALL
#5

Updated by Florian Otto 3 months ago

Thanks for the detailed information.
We will have a look into this.

#6

Updated by Theo Wollenleben 2 months ago

Theo Wollenleben wrote:

I have no success trying to build Open eCard from source.

I found out that openSUSE has separate software packages java-<version>-jmods for Java modules. I can build Open eCard after installing them, so my apologies for the false alarm. However, the modules contain shared libraries with debug information, making the build huge in size, see bug #831.

#7

Updated by Theo Wollenleben 2 months ago

Theo Wollenleben wrote:

The app starts quickly with version 12.0.2 from https://jdk.java.net/archive/, with version 13 GA and later it takes a lot of time because Java is reading font files on my system on every start.

The issue also occurs with version 12 and lower when opening the "About" dialog.

Also available in: Atom PDF