Open niloc132 opened 2 years ago
cc @mofojed
This is caused by the dependency on our Plotting libraries to java.awt.Color
and friends - some JVM installations are "headless" and do not provide awt, and server startup fails with plotting enabled.
This might only happen right away with groovy, more testing would be a good idea.
As a simple workaround, installing a non-headless JVM will get past this issue.
It surprises me that we haven't hit this before. Ostensibly, we are installed the headless jvm in our docker images:
Our docker container indeed doesn't hit this, but it has these:
/usr/lib/jvm/java-11-openjdk-amd64/lib/libawt.so
/usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_headless.so
My read is that libawt.so is what the jvm loads as part of this, and Bender's jvm for some reason was loading libawt_xawt.so, perhaps because he was already running X, unlike our docker container.
I confirmed this by connecting the docker container to a running X instance and trying to run the same thing, roughly:
$ docker run -it --rm -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --user="$(id --user):$(id --group)" --entrypoint jshell deephaven/server:local-build
Dec 28, 2021 7:16:39 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: Couldn't create user preferences directory. User preferences are unusable.
Dec 28, 2021 7:16:39 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: java.io.IOException: No such file or directory
| Welcome to JShell -- Version 11.0.12
| For an introduction type: /help intro
jshell> java.awt.Color.decode("#000000")
| Exception java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
| at ClassLoader.loadLibrary (ClassLoader.java:2630)
| at Runtime.load0 (Runtime.java:768)
| at System.load (System.java:1837)
| at ClassLoader$NativeLibrary.load0 (Native Method)
| at ClassLoader$NativeLibrary.load (ClassLoader.java:2442)
| at ClassLoader$NativeLibrary.loadLibrary (ClassLoader.java:2498)
| at ClassLoader.loadLibrary0 (ClassLoader.java:2694)
| at ClassLoader.loadLibrary (ClassLoader.java:2648)
| at Runtime.loadLibrary0 (Runtime.java:830)
| at System.loadLibrary (System.java:1873)
| at Toolkit$3.run (Toolkit.java:1399)
| at Toolkit$3.run (Toolkit.java:1397)
| at AccessController.doPrivileged (Native Method)
| at Toolkit.loadLibraries (Toolkit.java:1396)
| at Toolkit.<clinit> (Toolkit.java:1429)
| at Color.<clinit> (Color.java:275)
| at (#1:1)
So this is pretty niche, a headless JVM on a machine running an X client.
Sorry, I forgot to follow up on this. I was going to "make it happen" on a fresh Ubuntu VM if you needed me to.
Regarding this comment.
So this is pretty niche, a headless JVM on a machine running an X client.
It's not niche because it's what our documentation tells you to install. https://deephaven.io/core/docs/how-to-guides/launch-build/ (expand Installing Java)