Modify

Opened 4 years ago

Closed 4 years ago

#7074 closed defect (fixed)

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

Reported by: fecht Owned by: airadier
Priority: normal Component: PlantUmlMacro
Severity: normal Keywords:
Cc: Trac Release: 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:

Attachments (1)

headlessAWT.patch (576 bytes) - added by fecht 4 years ago.
patch to run Java/AWT in headless mode

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by fecht

patch to run Java/AWT in headless mode

comment:1 Changed 4 years ago by airadier

  • Status changed from new to 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 4 years ago by fecht

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 4 years ago by rlrj60

Thanks for the path. It works fine for me.

comment:4 Changed 4 years ago by airadier

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.