LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-17-2004, 10:39 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
java can't connect to Xserver


hi need to run the following commands to debug a program
1 # Compile the java installation program
2 javac -classpath java java/Install/Install.java
3 # Execute the compiled java program
4 java -classpath java Install.Install -compile

but when i am executing i take the following message



akroneiro:/usr/local/JabberwockyBinary # ./install
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as th
e value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(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.<init>(Font.java:344)
at javax.swing.plaf.metal.DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme.java:195)
at javax.swing.plaf.metal.DefaultMetalTheme.getFont(DefaultMetalTheme.java:153)
at javax.swing.plaf.metal.DefaultMetalTheme.getControlTextFont(DefaultMetalTheme.java:129)
at javax.swing.plaf.metal.MetalLookAndFeel$FontActiveValue.createValue(MetalLookAndFeel.java:1399
)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:196)
at javax.swing.UIDefaults.get(UIDefaults.java:126)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
at javax.swing.UIDefaults.getFont(UIDefaults.java:346)
at javax.swing.UIManager.getFont(UIManager.java:491)
at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:89)
at javax.swing.plaf.basic.BasicLabelUI.installDefaults(BasicLabelUI.java:302)
at javax.swing.plaf.basic.BasicLabelUI.installUI(BasicLabelUI.java:254)
at javax.swing.JComponent.setUI(JComponent.java:449)
at javax.swing.JLabel.setUI(JLabel.java:238)
at javax.swing.JLabel.updateUI(JLabel.java:248)
at javax.swing.JLabel.<init>(JLabel.java:141)
at javax.swing.JLabel.<init>(JLabel.java:171)
at Install.Install.main(Install.java:71)





as you can see it can't connect as 0:0
the display has value


echo $DISPLAY
:0.0

What i must do?
 
Old 04-18-2004, 02:43 AM   #2
linuxmankev
LQ Newbie
 
Registered: Jan 2004
Distribution: Debian,Red Hat,Fedora
Posts: 10

Rep: Reputation: 0
xhost

try (as the user you are logged in as): xhost +

This is the X perms equivalent of putting chmod 0777 on a file but should stop your Xauth failures.

(A better, slightly more secure command is `xhost +local` which allows any local user to use the X display).

Then run the java thing again. Presumably you are running the java program as someone other than the one you logged into your XFree86 session with?

If that doesn't work, it could be some dodgy java - the line says it things :0.0 is invalid... so perhaps set it to:

export DISPLAY=localhost:0.0
or
export DISPLAY=akroneiro:0.0


Kev
 
Old 04-18-2004, 08:51 AM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
thx

thx for your time...
Look that only the last command seems working but still nothing

akroneiro:/usr/local/JabberwockyBinary # export DISPLAY=localhost:0.0
akroneiro:/usr/local/JabberwockyBinary # xhost +
Xlib: connection to "localhost:0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
xhost: unable to open display "localhost:0.0"

akroneiro:/usr/local/JabberwockyBinary # export DISPLAY=akroneiro:0.0
akroneiro:/usr/local/JabberwockyBinary # ./install
Xlib: connection to "akroneiro:0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window
server using 'akroneiro:0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:1
34)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi
ronment.java:62)
at java.awt.Font.initializeFont(Font.java:308)
at java.awt.Font.<init>(Font.java:344)
at javax.swing.plaf.metal.DefaultMetalTheme$FontDelegate.getFont(Default
MetalTheme.java:195)
at javax.swing.plaf.metal.DefaultMetalTheme.getFont(DefaultMetalTheme.ja
va:153)
at javax.swing.plaf.metal.DefaultMetalTheme.getControlTextFont(DefaultMe
talTheme.java:129)
at javax.swing.plaf.metal.MetalLookAndFeel$FontActiveValue.createValue(M
etalLookAndFeel.java:1399)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:196)
at javax.swing.UIDefaults.get(UIDefaults.java:126)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
at javax.swing.UIDefaults.getFont(UIDefaults.java:346)
at javax.swing.UIManager.getFont(UIManager.java:491)
at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:89)
at javax.swing.plaf.basic.BasicLabelUI.installDefaults(BasicLabelUI.java
:302)
at javax.swing.plaf.basic.BasicLabelUI.installUI(BasicLabelUI.java:254)
at javax.swing.JComponent.setUI(JComponent.java:449)
at javax.swing.JLabel.setUI(JLabel.java:238)
at javax.swing.JLabel.updateUI(JLabel.java:248)
at javax.swing.JLabel.<init>(JLabel.java:141)
at javax.swing.JLabel.<init>(JLabel.java:171)
at Install.Install.main(Install.java:71)
 
Old 04-18-2004, 08:56 AM   #4
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
thx

it works fine....!!!
The problem was that i was running the xterm as normal user and then i was entering in root mode...
The problem solved when i ran the Xserver as root
 
Old 04-18-2004, 08:58 AM   #5
linuxmankev
LQ Newbie
 
Registered: Jan 2004
Distribution: Debian,Red Hat,Fedora
Posts: 10

Rep: Reputation: 0
xhost +
Xlib: connection to "localhost:0.0" refused by server

says you are running the xhost command NOT as the person you originally logged in as.
The user that logs in controls "X11" - so if you log in as user1 and then su - user2 or something and try to run xhost as user2 you will get connection refused.

Presumably you are running Debian, su - ing and then running the command? Even root under Woody can't issue that command. Run it *as the user you have logged in as - not the one about to run the java command*

Kev
 
Old 01-10-2006, 12:29 AM   #6
zoombiein
LQ Newbie
 
Registered: Jan 2006
Posts: 1

Rep: Reputation: 0
use following command
debian1:/etc# grep -r "DisallowTCP" *
gdm/factory-gdm.confisallowTCP=true
gdm/factory-gdm.conf:# at the security/DisallowTCP setting!
gdm/gdm.confisallowTCP=true
gdm/gdm.conf:# at the security/DisallowTCP setting!
grep: rc2.d/K77ntp-simple: No such file or directory
grep: rc3.d/K77ntp-simple: No such file or directory
X11/gdm/factory-gdm.confisallowTCP=true
X11/gdm/factory-gdm.conf:# at the security/DisallowTCP setting!
X11/gdm/gdm.confisallowTCP=true
X11/gdm/gdm.conf:# at the security/DisallowTCP setting!

Change all the DisallowTCP=true to false then restart x server and u can run any java gui
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
java URLConnection: setDoIn/Output() vs connect() kpachopoulos Programming 4 01-14-2018 09:15 PM
can't connect to Xserver in Ubuntu hari78 Linux - Software 2 07-28-2009 10:55 PM
fluxbox Error: couldn't connect to xserver Furlinastis Slackware 4 09-22-2005 07:20 AM
xserver-xorg config warning: migrating xserver-xfree86 templates doctorwebbox Debian 9 07-27-2005 07:24 PM
Programming a Connect Four UI (Java) lambada Programming 5 11-10-2003 09:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration