my web application is running under tomcat 5.5, jdk 6 update 2, Centos 5 linux without x11 server installed.
i also use the below command :
JAVA_OPTS="-Xms16m -Xmx48m -Djava.awt.headless=true"
but when i call the method in "linux" i get the below exception:
java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:406)
at java.awt.Frame.<init>(Frame.java:402)
at java.awt.Frame.<init>(Frame.java:367)
at javax.swing.JFrame.<init>(JFrame.java:163)
at mypackage.MyClass.getImage(MyClass.java:103)
...
and the the line which produces exception in 'getImage()' is:
g2d.drawImage(image, 0, 0, newWidth, newHeight, 0, 0, image.getWidth(), image.getHeight(), new JFrame());
in spite of setting headless property to true i get the error.
any Idea?