RE: java.awt.HeadlessException
Hi, We have found that in order to get headless to work properly, you need the xlib libraries installed. You don't need an xserver _running_, but you need the libraries, because I think java.awt.* uses them. Here's a link: http://javatechniques.com/public/java/docs/hosting/headless-java-x11-librari es.html We've also found that JAVA needs help finding them, by adding the following line to catalina.sh: export LD_LIBRARY_PATH="/usr/X11/lib" Also of note is that the error message you get for this condition changes after the first occurrence. The very first time you try to generate an image dynamically, you'll get something like: org.apache.jasper.JasperException: /usr/local/applications/j2sdk-1_4_2_04/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory All subsequent times, it will be a different message, something like: java.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at java.awt.Toolkit$2.run(Toolkit.java:748) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:739) Maybe you knew all this, and xvfb (whatever that is) was meant to get around this. But all of the above works for us. > -Original Message- > From: indu ss [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 16, 2004 9:11 AM > To: [EMAIL PROTECTED] > Subject: java.awt.HeadlessException > > > Hi, > > I'm using Tomcat 5.0.12,J2sdk1.5 on Linux Fedora 2 . > > I need to have a servlet which displays jpg images > without using Xserver. > I get this error even after starting tomcat with > CATALINA_OPTS="-Djava.awt.headless=true" > and also with Xvfb running. > > java.awt.HeadlessException > at > java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment > .java:159) > at java.awt.Window.(Window.java:310) > at java.awt.Frame.(Frame.java:419) > at java.awt.Frame.(Frame.java:384) .. > > > > > > > __ > Do you Yahoo!? > The all-new My Yahoo! - Get yours free! > http://my.yahoo.com > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java.awt.HeadlessException
Hi, So modify your servlet to work properly in a headless environment, or use an alternative like Xvfb. This is not a Tomcat issue, so if you want to continue discussion on the mailing list please prepend [OFF-TOPIC] to the subject line. Thanks, Yoav Shapira http://www.yoavshapira.com >-Original Message- >From: indu ss [mailto:[EMAIL PROTECTED] >Sent: Tuesday, November 16, 2004 10:11 AM >To: [EMAIL PROTECTED] >Subject: java.awt.HeadlessException > >Hi, > >I'm using Tomcat 5.0.12,J2sdk1.5 on Linux Fedora 2 . > >I need to have a servlet which displays jpg images >without using Xserver. >I get this error even after starting tomcat with >CATALINA_OPTS="-Djava.awt.headless=true" >and also with Xvfb running. > >java.awt.HeadlessException > at >java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159 ) > at java.awt.Window.(Window.java:310) > at java.awt.Frame.(Frame.java:419) > at java.awt.Frame.(Frame.java:384) .. > > > > > > >__ >Do you Yahoo!? >The all-new My Yahoo! - Get yours free! >http://my.yahoo.com > > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]