Modify

Opened 15 years ago

Closed 14 years ago

#7074 closed defect (fixed)

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

Reported by: Carsten Fechtmann Owned by: Álvaro Iradier
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 Carsten Fechtmann 15 years ago.
patch to run Java/AWT in headless mode

Download all attachments as: .zip

Change History (5)

Changed 15 years ago by Carsten Fechtmann

Attachment: headlessAWT.patch added

patch to run Java/AWT in headless mode

comment:1 Changed 15 years ago by Álvaro Iradier

Status: newassigned

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

Thanks for the path. It works fine for me.

comment:4 Changed 14 years ago by Álvaro Iradier

Resolution: fixed
Status: assignedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Álvaro Iradier.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.