Tomcat crashes:Gtk-WARNING **: cannot open display (even though -Djava.awt.headless=true is enabled)

Support for webhosts that use CentOS
Post Reply
benr
Posts: 1
Joined: 2008/01/26 00:10:43

Tomcat crashes:Gtk-WARNING **: cannot open display (even tho

Post by benr » 2008/01/26 00:29:14

Hi,
Any help would be great!

My tomcat5 server crashes because of a java.awt issue.
Here is a simple jsp that demonstrates the problem:

[code]
System.out.println("java.awt.headless="+System.getProperty("java.awt.headless")+".");
java.awt.image.BufferedImage img = new java.awt.image.BufferedImage( 32, 32, java.awt.image.BufferedImage.TYPE_INT_RGB );
System.out.println("ok so far");
Object object = img.getGraphics();
System.out.println("done!");
[/code]

produces the following output:
[code]
java.awt.headless=true.
ok so far

(.:490): Gtk-WARNING **: cannot open display:
[/code]

I have JAVA_OPTS="-Djava.awt.headless=true" in my tomcat5.conf file.
as you can see from my jsp example java.awt.headless is being set to true yet
I am still getting the awt problem.
Searched the net for hours and no advice has helped.
I haven't gone down the Xvfb route yet... there must be an easier solution! :-o

Details:
Tomcat5
OS=Centos 5.1 installed
Java=1.4.2

Please help!
Regards, Ben

Post Reply

Return to “CentOS 5 - Webhosting Support”