How to package headless plantuml-server .war file

0 votes
asked Jun 15, 2021 in Question / help by orion

I'm trying to deploy the provided plantuml.war to a tomcat server.

The setup:
Apache Tomcat 8.5.42
JVM 12.0.1+12

I'm getting the following error when browsing to the generated png and svg:
Exception: java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.plantuml.ugraphic.UFont

I was previously told on this forum that this is due to the server being headless and that I need to set the flag "-Djava.awt.headless=true". However, there is no option/info on how to set this. Is this done in the pom.xml? In that case - how? If this really is the problem, then there should really be an option to set headless mode considering that the vast majority of servers Are headless...

commented Jul 22, 2021 by anonymous
Is there any way to run the .war file in headless mode, team? I would argue that servers are in general headless, so there should be some sort of support for this case.

1 Answer

0 votes
answered Aug 27, 2022 by anonymous
SOLUTION - missing package on headless server installation

e.g. on debian-bullseye you need to install the following package and its dependencies

https://packages.debian.org/bullseye/fontconfig
...