1

Topic: To launch X11 Server

I try   one program on the server.
I launch process $output = popen ("/usr/bin/charlesbg", "r")
Always worked, today not  I look result of performance:

wrote:

Exception in thread "main" java.awt. AWTError: Can't connect to X11 window server using ':3
:1 ' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay (Native Method)
at sun.awt.X11GraphicsEnvironment.access$200 (X11GraphicsEnvironment.java:65)
at sun.awt. X11GraphicsEnvironment$1.run (X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged (Native Method)
at sun.awt. X11GraphicsEnvironment. <clinit> (X11GraphicsEnvironment.java:74)
at java.lang. Class.forName0 (Native Method)
at java.lang. Class.forName (Class.java:264)
at java.awt. GraphicsEnvironment.createGE (GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment (GraphicsEnvironment.java:82)
at de.sciss.syntaxpane.DefaultSyntaxKit.initKit (DefaultSyntaxKit.java:503)
at de.sciss.syntaxpane.DefaultSyntaxKit.<clinit> (DefaultSyntaxKit.java:103)
at com.xk72.charles.gui.lib.UIUtils.<clinit> (Unknown Source)
at com.xk72.charles.gui. Main.wfpb (Unknown Source)
at com.xk72.charles. Main. OjEP (Unknown Source)
at com.xk72.charles.gui. Main.main (Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect. Method.invoke (Method.java:498)
at com.xk72.charles.gui.transaction.viewers.protobuf.prei.OjEP (Unknown Source)
at com.xk72.charles.gui.MainWithClassLoader.main (Unknown Source)
Exception in thread "main" java.awt. AWTError: Can't connect to X11 window server using ':3
:1 ' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay (Native Method)
at sun.awt.X11GraphicsEnvironment.access$200 (X11GraphicsEnvironment.java:65)
at sun.awt. X11GraphicsEnvironment$1.run (X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged (Native Method)
at sun.awt. X11GraphicsEnvironment. <clinit> (X11GraphicsEnvironment.java:74)
at java.lang. Class.forName0 (Native Method)
at java.lang. Class.forName (Class.java:264)
at java.awt. GraphicsEnvironment.createGE (GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment (GraphicsEnvironment.java:82)
at de.sciss.syntaxpane.DefaultSyntaxKit.initKit (DefaultSyntaxKit.java:503)
at de.sciss.syntaxpane.DefaultSyntaxKit.<clinit> (DefaultSyntaxKit.java:103)
at com.xk72.charles.gui.lib.UIUtils.<clinit> (Unknown Source)
at com.xk72.charles.gui. Main.wfpb (Unknown Source)
at com.xk72.charles. Main. OjEP (Unknown Source)
at com.xk72.charles.gui. Main.main (Unknown Source)

I so understood it is necessary to launch this most X11 Server. A question AS? On googled but while suitable decision not !
Whether restarting of all server helps here?
And here that I am interesting in manual a program I launch without problems ((

2

Re: To launch X11 Server

 echo $DISPLAY 

3

Re: To launch X11 Server

Areostar;
To check up what variable DISPLAY you is installed at the process, launching the program
For example at httpd
We define pid

ps-ef | grep <the Mask of a name of your program>
strings-a/proc / <pid>/env | grep DISPLAY

4

Re: To launch X11 Server

wrote:

[2:45:58 PM] root@scw-e9236f:/var/www/webpy-app# ps-ef | grep charles
root 5308 5215 0 14:46 pts/1 0:00:00 AM grep - color=auto charles
apache 32474 1 0 12:46? 0:00:00 AM/bin/bash-e/usr/bin/charles4
apache 32484 32474 3 12:46? 0:04:49 AM/usr/lib/charles-proxy/jre/bin/java-Xmx1024M-Dcharles.config = ~/.charles.config-jar/usr/lib/charles-proxy/charles.jar

Tried to substitute in the second line

wrote:

[2:46:35 PM] root@scw-e9236f:/var/www/webpy-app# strings-a/proc/32474/env | grep DISPLAY
strings: '/proc/32474/env ': No such file
[2:47:29 PM] root@scw-e9236f:/var/www/webpy-app# strings-a/proc/32474/env | grep DISPLAY
strings: '/proc/32474/env ': No such file
[2:47:45 PM] root@scw-e9236f:/var/www/webpy-app# strings-a/proc/32484/env | grep DISPLAY
strings: '/proc/32484/env ': No such file
[2:47:57 PM] root@scw-e9236f:/var/www/webpy-app# strings-a/proc/32474/env | grep DISPLAY
strings: '/proc/32474/env ': No such file

That I not so do

5

Re: To launch X11 Server

Areostar;
What for OS?
I wrote the decision for linux

6

Re: To launch X11 Server

Areostar;
For  file name another, wrote on knees, the system near at hand was not
Here it is correct:

strings/proc/5239/>>> environ <<<| grep LANG
LANG=en_US.UTF-8

7

Re: To launch X11 Server

OS CENTOS 7 On how many I understand.
In  I understand feeblly. So if it is possible explain explicitly. wink

8

Re: To launch X11 Server

Areostar wrote:

OS CENTOS 7 On how many I understand.
In  I understand feeblly. So if it is possible explain explicitly. wink

like all told (was mistaken only in a name pseudo a file environ together env):
We search PID, further for this process it is checked variable DISPLAY
strings - it is necessary, as/proc / <PID>/environ are a binary data
(ASCIIZ lines), that is lines which come to an end with '\000 ' character
grep - the stream filter

ps-ef | grep <the Mask of a name of your program>
strings/proc / <PID>/environ | grep DISPLAY