Stops working on a headless machine

Description

java.lang.InternalError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable

Solution: add parameter in startup script
java -Djava.awt.headless=true -jar "$SCRIPTPATH/../lib/jasperstarter.jar" "$@"

Problem seems to occur after a few days on a django website. If I run the script manually it will always work.
sample python code:

cmd="/opt/jasperstarter/bin/jasperstarter" + " pr -t postgres -u postgres -f pdf -H localhost -n bgmc /var/www/bgmc/rapporten/leverancier_tracering.jrxml -o /tmp/%s -p postgres -P uuid=%s"%(uniekid,uniekid)

(out, err) = Popen(cmd, close_fds=True, shell=True).communicate(None)

After I added the "headless" startup parameter the problem never occured again.

X is installed on the machine but not running. Django is running with Gunicorn.

Environment

Linux

Assignee

Volker Voßkämper

Reporter

Marnik Joosten

Labels

None

Components

Affects versions

Priority

Minor
Configure