Introduction
This article explains how to resolve export task failures related to Universes or Connections when Tomcat runs in an environment without a graphical subsystem.
Environment
- Product: 360Suite Web Platform
- Product version: all versions
- Operating systems: Windows or Linux
Symptoms
- Export tasks involving Universes or Connections fail.
- The error appears in the task logs.
Error Message
Fatal error stopped the task execution:
java.lang.NoClassDefFoundError: Could not initialize class
sun.awt.X11GraphicsEnvironmentCause
This error occurs when the Java Virtual Machine used by Tomcat does not have access to a graphical environment.
Resolution
Add the following Java option to the Tomcat configuration:
-Djava.awt.headless=true
This forces Java to run in headless mode, which avoids initialization of graphical components not available on the server.
Windows
- Open the Tomcat Configuration application.
- Go to the Java tab.
- Add
-Djava.awt.headless=trueto the existing Java options. - Save the configuration and restart Tomcat.
Linux
- Go to
<CATALINA_HOME>/bin. - Create a
setenv.shfile if it does not already exist. - Add or update the following lines:
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
export JAVA_OPTS
- Save the file and restart Tomcat.
Additional Information
After applying the change, rerun the export task and verify in the task logs that the error no longer occurs.
