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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to