Program works but problem with display
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sid_northfield
Posted On:   Friday, August 23, 2002 04:45 AM

I am getting this display program. The program works on windows and linux but not where I favour to work from. [sidte5115@node00 w0109699]$ cd Bank [sidte5115@node00 Bank]$ appletviewer NorthfieldBanque.java Xlib: connection to "whale.cscs.qmw.ac.uk:49.0" refused by server Xlib: Client is not authorized to connect to Server Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'whale.cscs.qmw.ac.uk:49.0' as the value of the DISPLAY variable . at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.   More>>


I am getting this display program. The program works on windows and linux but not where I favour to work from.



[sidte5115@node00 w0109699]$ cd Bank

[sidte5115@node00 Bank]$ appletviewer NorthfieldBanque.java

Xlib: connection to "whale.cscs.qmw.ac.uk:49.0" refused by server

Xlib: Client is not authorized to connect to Server

Exception in thread "main" java.lang.InternalError: Can't connect to

X11
window

server using 'whale.cscs.qmw.ac.uk:49.0' as the value of the DISPLAY

variable

.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)

at

sun.awt.X11GraphicsEnvironment. (X11GraphicsEnvironment.java:5

9)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:120)

at

java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi

ronment.java:58)

at java.awt.Window. (Window.java:188)

at java.awt.Frame. (Frame.java:315)

at java.awt.Frame. (Frame.java:262)

at sun.applet.AppletViewer. (AppletViewer.java:139)

at

sun.applet.StdAppletViewerFactory.createAppletViewer(AppletViewer.jav

a:81)

at sun.applet.AppletViewer.parse
(AppletViewer.java:1035)

at sun.applet.AppletViewer.parse
(AppletViewer.java:969)

at sun.applet.Main.run(Main.java:140)

at sun.applet.Main.main(Main.java:82)

[sidte5115@node00 BankCW1]$




I have tried



man xhost




I have read this very small manual but it doesn't help.



I have tried 4 different servers: whale, cetacean, porpoise and

dolphin. All gave the same error.



The last server I tried via dolphine, it works on this but the laboratory is favoured by first year undergradutes.


   <<Less

Re: Program works but problem with display

Posted By:   michael_dean  
Posted On:   Sunday, August 25, 2002 12:17 AM

The problem is that you are trying to execute a GUI application remotely (i.e. you are logged in to the machine "node00" and are trying to execute the application but display its user interface on "whale.cscs.qmw.ac.uk"). In order to do this, you must be given access to the X Windows server running on the remote host.



As you mentioned in your post, this can be accomplished by having the user who "owns" the X server on "whale" do an "xhost +" (very, very, very insecure) or "xhost +node00" (very, very insecure). However, because xhost is an insecure mechanism, I highly recommend using another approach.



For an in-depth discussion on running X Windows applications remotely, see the Remote X Apps mini-HOWTO. Pay particular attention to sections 6.2 (xauth) and 6.3 (SSH). I highly recommend using SSH with X-forwarding enabled. It is by far the easiest approach (everything is set up automatically by SSH) and the most secure (especially when coupled with Kerberos for authentication).



If your intent is not to execute the application on "node00" and display its interface on "whale," you need to change your DISPLAY environment variable to use the local machine's display. To do this, execute the command:




export DISPLAY=:0


in a Bourne shell (sh) or Bourne-compatible shell (like bash) before issuing the appletviewer command. Or, change the variable for the one command with:




DISPLAY=:0 appletviewer NorthfieldBanque.java

Re: Program works but problem with display

Posted By:   Simon_Ablett  
Posted On:   Friday, August 23, 2002 06:14 AM

At a guess I would say that there's a problem with the way X-windows system has been configured on your Unix boxes. You need to explicitly grant display rights on machines running X-Windows. If xhost is not working it could simply be that you don't have the correct access rights on those machines. Speak to your sys-admin guys.

Regards.

P.S.it's also probably not a good idea to be handing out information about your domain and server names on a forum like this.
About | Sitemap | Contact