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?

1 Answer 1


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.

  • 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, 2012 at 20:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .