Thanks Christopher,
can you please post the entire servlet sample code you used!
can't figure what I'm doing wrong here. vasile




                                                                                       
    
                    "Christopher                                                       
    
                    K. St. John"         To:     Tomcat Users List                     
    
                    <cks@distribu        <[EMAIL PROTECTED]>              
    
                    topia.com>           cc:                                           
    
                                         Subject:     Re: Tomcat and j2se1.4 with 
headless 
                    02/08/02             support                                       
    
                    04:56 PM                                                           
    
                    Please                                                             
    
                    respond to                                                         
    
                    "Tomcat Users                                                      
    
                    List"                                                              
    
                                                                                       
    
                                                                                       
    




[EMAIL PROTECTED] wrote:
>
> I modified catalina.sh file inserting
> if [ -z "$CATALINA_OPTS" ] ;
> then  CATALINA_OPTS="-Djava.awt.headless=true" #### headless support
>

 I think the idea is that you just need to do a:

   $ export CATALINA_OPTS="-Djava.awt.headless=true"
   $ bin/startup.sh

 No need to actually modify the catalina.sh code, it will
automatically pick up the environment variable. I just tried
it with code like:

      BufferedImage bi = new
BufferedImage(128,128,BufferedImage.TYPE_INT_RGB);
      Graphics2D g = bi.createGraphics();
      g.drawLine(0, 0, 120, 120);
      Raster r = bi.getData();
      rsp.setContentType("image/jpeg");
      JPEGImageEncoder ie = JPEGCodec.createJPEGEncoder(rsp.getOutputStream
());
      ie.encode(bi);

 and it worked fine.


> java.awt.HeadlessException at
> java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121)
>            at java.awt.Window.(Window.java:251)
>            at java.awt.Frame.(Frame.java:398)

 Are you trying to create a Frame? Heavyweight components
are always going to throw HeadlessExceptions, ref:

  http://java.sun.com/j2se/1.4/docs/guide/awt/AWTChanges.html




--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>






--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to