Screaming Headless Servers
Problem
If you’re working with a server-side application, like I am, that imports a
javax.swingpackage, you might get strange errors, such as the one described here.
javax.swingpackages expect to find an X11 server running on the machine. In my case, it wants to access the graphical subsystem because JFreeReport wants to use a
TableModelas a kind of spreadsheet.
Solution
append
java.awt.headless=trueto your
JAVA_OPTS<pre> in catalina.sh. Mine ended up looking like this.</p>
<pre>
JAVA_OPTS=-Dsalmon.props.path=/home/opgi/bin/jakarta-tomcat-4.1.30/salmon/properties
JAVA_OPTS = "$JAVA_OPTS -Djava.awt.headless=true"
</pre>