Skip to contentSkip to conversation

connection problem to the X server

DISCUSSION Miguel González Castaños 2 participants 2 messages Apr 22, 2004

lore
Share & tools
lore
#0 lore raw

Dear all,

I have a web application developed using JSPs, that needs to connect to a X server to show a statistics graphic. The logs when I issue an "xhost + localhost" of Tomcat gives this :

Xlib: connection to "localhost:0.0" refused by server
Xlib: No protocol specified

xhost: unable to open display "localhost:0.0"

When I issue a xhost to a different box, it doesnt fail. I have been googling a bit, I got the impression that using xhost is not safe, and it is better to use xauth. Anyway I still dont know how to fix this.

Regards and sorry for my english

Miguel

#1 lore raw
Quoted 4 lines · Miguel González Castaños

I have a web application developed using JSPs, that needs to connect to a X server to show a statistics graphic. The logs when I issue an "xhost
+ localhost" of Tomcat gives this :

Quoted 8 lines

Xlib: connection to "localhost:0.0" refused by server
Xlib: No protocol specified

xhost: unable to open display "localhost:0.0"

When I issue a xhost to a different box, it doesnt fail. I have been googling a bit, I got the impression that using xhost is not safe, and it is better to use xauth. Anyway I still dont know how to fix this.

If the X server is already using X authentication, it won't allow xhost to connect. Run xhost without arguments; if you get the response:

	$ xhost
	access control enabled, only authorized clients can connect

then the X server is using X authentication. In that case, you will have to copy the necessary authentication credentials into a file which can be read by Tomcat, and set the environment variable XAUTHORITY to refer to that file. See "man xauth" for details.

Signature · 5 lines
Glynn Clements <[email protected]>
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html