If you start Tomcat from an Xterm it will pick up the X environment, but if
you start
it via telnet or as part of your boot process, it won't pick it up.
In that case you'll need Xvfb (X virtual frame buffer), in order to provide
a native
graphics enivronment, so that you can build your gif.
Xvfb is usually bundled with XFree86, so it's probably already on your
machine.
There are a number of references to Xvfb in the mailing list archives, which
should
help you in using it.

> -----Original Message-----
> From: Emmanuel PINARD - Sicavonline [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 09, 2001 4:45 AM
> To: [EMAIL PROTECTED]; Gabriel Ciuloaica
> Subject: RE: error message while creating a gif from a servlet
>
>
> Thanks,
>
> but it seems there 's already an X started
>
> ps awx:
>
>   943 ?        S      0:00 /etc/X11/X -auth /var/gdm/:0.Xauth :0
> INIT_VERSION=sysvinit-2.78 TERM=linux HOSTTYPE=i386 PATH=/sbin:/usr
>
> I must tell you that I know a little Linux but i'm not an expert.
>
> Emmanuel P.
>
>
> -----Message d'origine-----
> De : Gabriel Ciuloaica [mailto:[EMAIL PROTECTED]]
> Envoyé : mercredi 9 août 2000 11:27
> À : [EMAIL PROTECTED]
> Objet : Re: error message while creating a gif from a servlet
>
>
> Must to start XWindows system before you start tomcat.
>
> Gabriel Ciuloaica
> ----- Original Message -----
> From: "Emmanuel PINARD - Sicavonline" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 09, 2001 1:24 PM
> Subject: error message while creating a gif from a servlet
>
>
> > Hello ,
> >
> > I'm using Tomcat with apache in a RedHat6.2
> > I got this message while i was trying to return a data stream to my
> browser
> > in order to create a gif.
> >
> > Emmanuel P.
> >
> >
> --------------------------------------------------------------------------
> --
> > -----------
> >
> > Error: 500
> > Location: /examples/servlet/Fury
> > Internal Servlet Error:
> >
> > java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment
> > at java.lang.Class.forName0(Native Method)
> > at java.lang.Class.forName(Class.java, Compiled Code)
> > at
> >
> java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsE
> nvironment
> > .java, Compiled Code)
> > .
> > .
> > .
> > .
> > at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
> > Compiled Code)
> > at java.lang.Thread.run(Thread.java, Compiled Code)
> >
> >
> >
> --------------------------------------------------------------------------
> --
> > ---------
> >
> > my code is:
> >
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> > import java.io.*;
> > import java.util.*;
> > import Acme.JPM.Encoders.*;
> > import java.awt.image.*;
> > import java.awt.*;
> >
> > public class Fury extends HttpServlet {
> >
> >     public void doGet(HttpServletRequest request, HttpServletResponse
> > response)
> >        throws    ServletException, IOException
> > {
> >         response.setContentType("image/gif");
> >         ServletOutputStream out = response.getOutputStream();
> >         BufferedImage graph = new BufferedImage(100,100,
> > BufferedImage.TYPE_INT_RGB);
> >
> >   Graphics g = null;
> >   g = graph.getGraphics();
> >         g.setColor(Color.green);
> >         g.fillRect(0, 0, 100, 100);
> >         g.setColor(Color.red);
> >         g.drawOval(0, 0, 100,100);
> >         new GifEncoder(graph, out, true).encode();
> >         out.close();
> >       }
> >
> >     public void doPost(HttpServletRequest request, HttpServletResponse
> > response)
> >         throws ServletException, IOException {
> >         doGet(request,response);
> >     }
> > }
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to