----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

I'm trying to write a simple servlet that will return a gif to the caller.
Below is the servlet code, and the error from jserv.log.

Enviro:
RedHat 6.0
ApacheJserv 1.0
BlackDown jdk1.2

Also - I am running an xserver.

thanks!

I am getting the following error - and I have an xserver running.  Below is
the servlet and the error I'm getting in jserv.log.

Any help would be appreciated!
==========================================================
jserv.log:

[01/11/1999 13:15:35:710 EST] Servlet-Error: java.lang.NoClassDefFoundError:
sun/awt/X11GraphicsEnvironment: sun/awt/X11GraphicsEnvironment
[01/11/1999 13:15:35:713 EST] java.lang.NoClassDefFoundError:
sun/awt/X11GraphicsEnvironment
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Compiled Code)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Compiled
Code)
        at java.awt.image.BufferedImage.createGraphics(Compiled Code)
        at java.awt.image.BufferedImage.getGraphics(Compiled Code)
        at C2Chart.doPost(Compiled Code)
        at C2Chart.doGet(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at org.apache.jserv.JServConnection.processRequest(Compiled Code)
        at org.apache.jserv.JServConnection.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)
===========================================================
chart.java:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.awt.*;
import java.awt.image.*;
import Acme.JPM.Encoders.*;


public class chart extends HttpServlet {

        public void init(ServletConfig config) 
                throws ServletException 
        {
                super.init(config);
        }

        // Process the HTTP GET request
        public void doGet(HttpServletRequest request, HttpServletResponse
response)
                throws ServletException, IOException 
        {
                doPost(request, response);
        }
                

        // Process the HTTP POST request
        public void doPost(HttpServletRequest request, HttpServletResponse
response)
                throws ServletException, IOException 
        {
                BufferedImage image = new BufferedImage(200, 200,
BufferedImage.TYPE_INT_RGB);
                Graphics g = image.getGraphics();
                g.setColor(Color.white);
                g.fillRect(0, 0, 200, 200);
                g.setColor(Color.red);
                g.drawOval(0, 0, 100, 150);

                response.setContentType("image/gif");
                ServletOutputStream out = response.getOutputStream();
                GifEncoder encoder = new GifEncoder(image, out);
                encoder.encode();
                out.close();
        }

        // Get servlet information...
        public String getServletInfo()
        {
                return "Chart Servler Information";
        }
}


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to