Click to See Complete Forum and Search --> : Help needed . . .


dayanandasekar
06-14-2006, 11:06 AM
Hello,

I am using a 3rd party image generation library in my web applicaton. When I deploy the application to tomcat i get this exception instead of the image.

I tried stuff like setting the below to Catalina.sh

java.awt.headless=true

but nothing seems to be working.

My platform is a linux 2.6

Please help if you have come across this . . . and solved it . . .

java.awt.HeadlessException
sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:65)

Khalid Ali
06-14-2006, 05:23 PM
you will need to set it like below, and you will have to do it at the command line where catalina runs the jvm

-Djava.awt.headless=true

dayanandasekar
06-14-2006, 09:49 PM
Hi Khalid,

I set the java.awt.headless=true using CATALINA_OPTS i even hava a JSP page which displays all system properties and there it shows

java.awt.headless set to true.

But the image is not getting displayed and it shows

java.awt.HeadlessException
sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:65)

Thanks,

Khalid Ali
06-15-2006, 01:16 AM
either u did not read what I suggested or I am missing something...did u use the command which I posted above in the command line code for jvm startup?

dayanandasekar
06-15-2006, 04:53 AM
Of course yes,

I set the java.awt.headless=true the following way

created and environment variable CATALINA_OPTS="-Djava.awt.headless=true"

To confirm I have a jsp page which displays System.getProperties();

And java.awt.headless is show set to true

Thanks,

Khalid Ali
06-15-2006, 08:47 AM
I am not sure how ur catalina script works, but u need to set this value in the

Command line code that starts the JVM