----------------------------------------------------------------
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!!!
----------------------------------------------------------------

Hi,

In the java program to output a GIF file, the following line causes an error
during run time.
GifEncoder encoder = new GifEncoder(image, out);

In my jserv.properties, I have included the the path for Acme classes as
follows.

wrapper.classpath=/usr/local/apache/libexec/ApacheJServ.jar
wrapper.classpath=/export/JSDK2.0/lib/jsdk.jar
wrapper.classpath=/export/JSDK2.0/lib/
wrapper.classpath=/export/Acme/

Do I need to do some other configuration for it to work.

My program is as follows:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.awt.*;
import Acme.JPM.Encoders.GifEncoder;
public class grprog extends HttpServlet {
    public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
        Graphics g = null;
        Frame frame = null;
        ServletOutputStream out = res.getOutputStream();
        try {
            frame = new Frame();
            frame.addNotify();
            Image image = frame.createImage(400, 60);
            g = image.getGraphics();
            g.setFont(new Font("Serif", Font.ITALIC, 48));
            g.drawString("Hello world!", 10, 50);
            res.setContentType("image/gif");
            GifEncoder encoder = new GifEncoder(image, out);
            //encoder.encode();  // by commenting this line out, I don't get
any errors/exceptions at runtime
            res.setContentType("text/html");
            out.println("Hello2");
            }
        catch(Exception e){e.printStackTrace();}

    }
}

Any help is appreciated....


--
--------------------------------------------------------------
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