tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Ciuloaica" <g...@bam.codec.ro>
Subject Re: error message while creating a gif from a servlet
Date Wed, 09 Aug 2000 09:26:38 GMT
Must to start XWindows system before you start tomcat.

Gabriel Ciuloaica
----- Original Message -----
From: "Emmanuel PINARD - Sicavonline" <ep@sicavonline.fr>
To: <tomcat-user@jakarta.apache.org>
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(GraphicsEnvironment
> .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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message