Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running the built-in Apache Tomcat 6.0 under Mac OS X Server 10.6.6. Tomcat runs Hudson and Hudson runs a script which needs to connect to the local WindowServer process. This does not seem to be allowed for the user appserver that Tomcat is configured to run under:

FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL

According to this technote connections to the window server are only allowed for the currently logged in user and for root. Is there a solution that does not require Tomcat to be re-configured to run as root or as the console user?

share|improve this question

Java allows so-called "headless" operation when performing certain AWT-related functions like creating off-screen bitmaps, performing image manipulation, etc. but there are some operations that actually require access to a real windowing system.

My guess is that one of these specific functions is being hit and I'm not sure you have any options at this point besides avoiding using that function.

What is the full stack trace of the error, and what function are you trying to use? Hudson ought to be able to generate graphics, etc. without access to the windowing system.

share|improve this answer
Tomcat is already launched with "-Djava.awt.headless=true". The program that needs to connect to the window server is a C++ program that is launched by a script. – sakra May 25 '12 at 20:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.