Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#935336: jsvc on buster doesn't support the installable openjdk version

581 views
Skip to first unread message

Nick Minkler

unread,
Aug 21, 2019, 3:00:03 PM8/21/19
to
Package: jsvc
Version: 1.0.15-8

When attempting to run a jsvc daemon on buster using the available openjdk installation jsvc complains that JAVA_HOME is not set to a valid VM:

"Cannot find any VM in Java Home /usr/lib/jvm/default-java"

Listing the contents of /usr/lib/jvm/ shows that default-java is correctly linked to java-11-openjdk-amd64 that is installed from the openjdk-11-jre package.

jsvc didn't appear to add support for java 9+ until 1.1.x line and the most recent version available in debian is 1.0.x. If debian is shipping openjdk-11 in buster. one would think we would also ship a jsvc that works with it.

ii  openjdk-11-jre:amd64                  11.0.4+11-1~deb10u1             amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-11-jre-headless:amd64         11.0.4+11-1~deb10u1             amd64        OpenJDK Java runtime, using Hotspot JIT (headless)
ii  jsvc                                  1.0.15-8                        amd64        Wrapper to launch Java applications as daemons

--
Nick Minkler
Software Development
Integrated Services, Inc.
nick.m...@ints.com
www.ints.com
P:800.252.3099 x286
F:503.968.9100

Kevin P. Fleming

unread,
Jun 8, 2020, 7:50:03 AM6/8/20
to
This problem is caused by the location of libjvm.so. For example, when
I install openjdk-11-jre-headless:arm64, I get this directory:

/usr/lib/jvm/java-11-openjdk-arm64/lib/server

which contains libjvm.so (among other files).

However, jsvc looks in:

/usr/lib/jvm/java-11-openjdk-arm64/lib/$(uname -m)/server

This means it cannot find the necessary library. I have been working
around this by adding a subdirectory under `lib` named the same as
`uname -m` reports, and then creating a symlink `server` in that
directory which points to the `server` directory one level up.

Graeme Vetterlein

unread,
Mar 27, 2021, 6:30:03 PM3/27/21
to
Package: jsvc
Version: 1.0.15-8
Followup-For: Bug #935336

Dear Maintainer,


Software supplied by Ubiquiti (Wifi routers) fails because of this bug.
The bug was fixed in https://issues.apache.org/jira/browse/DAEMON-410 and so
release 1.2.3

Annotated debug is:

Mar 27 21:15:50 real unifi.init[7070]: user changed to 'unifi'
Mar 27 21:15:50 real unifi.init[7070]: User 'unifi' validated
Mar 27 21:15:50 real unifi.init[7070]: Attempting to locate Java Home in
/usr/lib/jvm/java-11-openjdk-amd64
Mar 27 21:15:50 real unifi.init[7070]: Attempting to locate VM configuration
file /usr/lib/jvm/java-11-openjdk-amd64/jre/lib/jvm.cfg
Mar 27 21:15:50 real unifi.init[7070]: Attempting to locate VM configuration
file /usr/lib/jvm/java-11-openjdk-amd64/lib/jvm.cfg
Mar 27 21:15:50 real unifi.init[7070]: Found VM configuration file at
/usr/lib/jvm/java-11-openjdk-amd64/lib/jvm.cfg
Mar 27 21:15:50 real unifi.init[7070]: Found VM server definition in
configuration

GV> the file: /usr/lib/jvm/java-11-openjdk-amd64/lib/jvm.cfg:
-server KNOWN
-client IGNORE
-zero KNOWN
-dcevm KNOWN


Mar 27 21:15:50 real unifi.init[7070]: Checking library
/usr/lib/jvm/java-11-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Mar 27 21:15:50 real unifi.init[7070]: Checking library
/usr/lib/jvm/java-11-openjdk-amd64/lib/amd64/server/libjvm.so
Mar 27 21:15:50 real unifi.init[7070]: Cannot locate library for VM server
(skipping)

GV> it's here ========================================>
/usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so

Appears to be this --> https://issues.apache.org/jira/browse/DAEMON-410


The patch is:

--- src1/native/unix/native/location.c 2019-11-20 03:40:52.426012014 -0800
+++ src/native/unix/native/location.c 2019-11-20 03:41:53.705012149 -0800
@@ -118,6 +118,7 @@
"$JAVA_HOME/jre/lib/libjvm.so",
"$JAVA_HOME/lib/classic/libjvm.so",
"$JAVA_HOME/lib/client/libjvm.so",
+ "$JAVA_HOME/lib/server/libjvm.so",
"$JAVA_HOME/lib/libjvm.so",
"$JAVA_HOME/jre/bin/classic/libjvm.so",
"$JAVA_HOME/jre/bin/client/libjvm.so"



Which you can see does contain the correct path for java-11-openjdk . This is
also broken/missing in later debian builds


As a workaround, many users are installing old Java8 JREs and running ubuntu in
a docker container




-- System Information:
Debian Release: 10.8
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-14-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages jsvc depends on:
ii libc6 2.28-10
ii libcommons-daemon-java 1.0.15-8

Versions of packages jsvc recommends:
ii default-jre-headless [java2-runtime-headless] 2:1.11-71
ii openjdk-11-jre-headless [java2-runtime-headless] 11.0.9.1+1-1~deb10u2

jsvc suggests no packages.

-- no debconf information

Chris Hofstaedtler

unread,
Jul 7, 2022, 3:30:04 PM7/7/22
to
Hello tony,

> * Add patch to locate recent JDKs (Closes: #935336)

Thanks for applying this patch, however it does not seem to work:

| % jsvc -debug foo
[..]
| Attempting to locate Java Home in /usr/lib/jvm/default-java
| Attempting to locate VM configuration file /usr/lib/jvm/default-java/jre/lib/jvm.cfg
| Attempting to locate VM configuration file /usr/lib/jvm/default-java/lib/jvm.cfg
| Found VM configuration file at /usr/lib/jvm/default-java/lib/jvm.cfg
| Found VM server definition in configuration
| Checking library /usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so
| Checking library /usr/lib/jvm/default-java/lib/amd64/server/libjvm.so
| Cannot locate library for VM server (skipping)
[..]
| Java Home located in /usr/lib/jvm/default-java
| +-- DUMPING JAVA HOME STRUCTURE ------------------------
| | Java Home: "/usr/lib/jvm/default-java"
| | Java VM Config.: "/usr/lib/jvm/default-java/lib/jvm.cfg"
| | Found JVMs: 0
| +-------------------------------------------------------
| Cannot find any VM in Java Home /usr/lib/jvm/default-java

Please consider applying the attached patch instead, which will lead
to:

| Found VM configuration file at /usr/lib/jvm/default-java/lib/jvm.cfg
| Found VM server definition in configuration
| Checking library /usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so
| Checking library /usr/lib/jvm/default-java/lib/amd64/server/libjvm.so
| Checking library /usr/lib/jvm/default-java/lib/server/libjvm.so
[..]
| Java Home located in /usr/lib/jvm/default-java
| +-- DUMPING JAVA HOME STRUCTURE ------------------------
| | Java Home: "/usr/lib/jvm/default-java"
| | Java VM Config.: "/usr/lib/jvm/default-java/lib/jvm.cfg"
| | Found JVMs: 1
| | JVM Name: "server"
| | "/usr/lib/jvm/default-java/lib/server/libjvm.so"
| +-------------------------------------------------------
| Using default JVM in /usr/lib/jvm/default-java/lib/server/libjvm.so

Thanks,
Chris

PS: if you apply this, I would intend to send it to stable-updates.

debian-935336.patch

tony mancill

unread,
Jul 9, 2022, 11:40:04 PM7/9/22
to
Hi Chris,

On Thu, Jul 07, 2022 at 09:14:44PM +0200, Chris Hofstaedtler wrote:
> Hello tony,
>
> > * Add patch to locate recent JDKs (Closes: #935336)
>
> Thanks for applying this patch, however it does not seem to work:

:facepalm: Thank you for the updated patch. I will upload momentarily.

> PS: if you apply this, I would intend to send it to stable-updates.

Thank you for that too!

Regards,
tony
0 new messages