LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   X problem again (https://www.linuxquestions.org/questions/linux-general-1/x-problem-again-438722/)

jalla 04-25-2006 01:25 PM

X problem again
 
Hi,

I am trying to run a web application that uses some graphical interface (www.jfree.org) to generate a graph on "Linux test.bb.com 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux".

Getting this error:
Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLAY variable.
Code:

java.lang.InternalError: Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:134)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:141)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
        at java.awt.Font.initializeFont(Font.java:308)
        at java.awt.Font.(Font.java:344)
        at org.jfree.chart.plot.PiePlot.(Unknown Source)
        at org.jfree.chart.ChartFactory.createPieChart(Unknown Source)

Before starting application I did export DISPLAY=localhost:0.0 (also tried export DISPAY:0.0), doesn't help.
I also tried logging as root and running "xhost +" (and xhost +localhost) but getting Unable to open display.

I saw an error message when I rebooted the box "test login: Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list". Is this a source of my problem?
I also checked if xfs was running and yes it is actually
Code:

[root@test root]# ps waux | grep xfs
xfs        788  0.0  0.2  5648 3352 ?        S    20:11  0:00 [xfs]
root      1466  0.0  0.0  3576  632 pts/0    S    20:22  0:00 grep xfs

Anyone any suggestion? Thank you in advance

ataraxia 04-25-2006 01:49 PM

Are you running the application as the same user that's logged in to X? You need to.

The font error message from when you reboot is not important, ignore it.

jalla 04-25-2006 01:54 PM

app started with Putty
 
Hmm, not sure if I got it correctly, but the box is started and nobody is logged in. The web application is started via putty. The webapplication is actually resin. If you are asking if resin was started by root, yes the it is running as root user because it is listening to port 80.

jalla 04-25-2006 05:15 PM

Looks like Xvfb is running too:
Code:

[root@test root]# ps waux | grep Xvfb
root      835  0.0  0.0  8280  136 ?        S    Apr25  0:00 /usr/bin/X11/Xvfb -nolisten tcp :0
root      4422  0.0  0.0  3576  632 pts/0    S    00:12  0:00 grep Xvfb
[root@test root]#


jalla 04-26-2006 03:16 AM

I fixed the problem on resin, the solution was to pass -Djava.awt.headless=true argument.

spooon 04-26-2006 03:37 AM

Quote:

Originally Posted by jalla
Hmm, not sure if I got it correctly, but the box is started and nobody is logged in. The web application is started via putty. The webapplication is actually resin. If you are asking if resin was started by root, yes the it is running as root user because it is listening to port 80.

You are using it over SSH; so if you want to use X, you need to run an X server and use X forwarding, which you didn't do.


All times are GMT -5. The time now is 12:16 PM.