Opened 12 years ago

Closed 12 years ago

# [Patch] Can't connect to window server - not enough permissions

Reported by: Owned by: Carsten Fechtmann Álvaro Iradier normal PlantUmlMacro normal 0.11

### Description

In case there is a problem with Java (or rather AWT) to connect to the X-server, which might be due to the Apache process not being allowed access to X, the java process (running PlanUML.jar) should be started in a 'headless' mode.

Here is a patch, that should take care of this (it works for me / OS X 10.6 server)

Index: plantuml/macro.py
===================================================================
--- plantuml/macro.py	(revision 7928)
+++ plantuml/macro.py	(working copy)
@@ -50,7 +50,7 @@

if not graphs.has_key(img_id):

-            cmd = "java -jar \"%s\" -pipe" % (self.plantuml_jar)
+            cmd = "java -jar -Djava.awt.headless=true \"%s\" -pipe" % (self.plantuml_jar)
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
(stdout, stderr) = p.communicate(input=source)
if p.returncode != 0:


### Changed 12 years ago by Carsten Fechtmann

patch to run Java/AWT in headless mode

### comment:1 Changed 12 years ago by Álvaro Iradier

Status: new → assigned

Thanks for the patch,

do you know if this will affect the operation of other systems? (mine is working correctly without the headless option, will it work anyway?)

Thanks.

### comment:2 Changed 12 years ago by Carsten Fechtmann

It should work as well, as it only tells AWT not to go through the - for this operation not required X server - but just make the graphics to be passed on to Trac.

However, since my setup requires this patch, I am in no position to try what happens if it works with this patch also on systems, where it works already 'out of the box'.

On the other hand, if you got such a system, it is a simple thing to try out.

### comment:3 Changed 12 years ago by rlrj60

Thanks for the path. It works fine for me.

### comment:4 Changed 12 years ago by Álvaro Iradier

Resolution: → fixed assigned → closed

(In [8052]) Applied trac from fecht to run in headless mode. Thanks. Fixes #7074

### Modify Ticket

Change Properties