Hello,
 
I am new to servlets and Apache JServ.  I am running ApacheJServ-1.1b3 and Apache_1.3.9 on Redhat Linux 6.1.  My version of jdk is Blackdown jdk1.2.2 release 3.  I have got the configuration working fine for plain servlets, such as the Hello servlet, and also it works fine for servlets which connect to a mysql database.
 
However, my problems start when I am going to output an image to the webpage.  The following program which doesn't  do anything else than creating an image, but it still fails.
 
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
 
import java.awt.*;
import sun.awt.*;
import sun.awt.motif.*;
import sun.awt.motif.MToolkit;
public class chartTst extends HttpServlet
{
    public void init(ServletConfig conf) throws ServletException
    {
       super.init(conf);
       Frame sourceFrame = new Frame();
       sourceFrame.addNotify();
       Image im = sourceFrame.createImage(100,100);
       Graphics g = im.getGraphics();
       g.drawString("Hello",50,50);
    }
}
 
The error it generates in the jserv.log is as follows
[24/01/2000 17:25:27:458 GMT+00:00] <servletException> java.lang.NoClassDefFoundError: sun/awt/motif/MToolkit    
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java, Compiled Code)
        at java.awt.Toolkit$2.run(Toolkit.java, Compiled Code)  
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java, Compiled Code)
        at java.awt.Window.getToolkit(Window.java, Compiled Code)
        at java.awt.Frame.addNotify(Frame.java, Compiled Code)
        at chartTst.init(chartTst.java, Compiled Code)
        at org.apache.jserv.JServServletManager.load_init(JServServletManager.java, Compiled Code)
        at org.apache.jserv.JServServletManager.loadServlet(JServServletManager.java, Compiled Code)
        at org.apache.jserv.JServConnection.processRequest(JServConnection.java, Compiled Code)
        at org.apache.jserv.JServConnection.run(JServConnection.java, Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)
 
The class sun/awt/motif/MToolkit is in the rt.jar (java runtime) and I have put it in the wrapper.classpath in jserv.properties, but nothing works.    
 
I have also had the following error
<servletException> java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
 
Does anyone know what the value of the DISPLAY variable should be?!
 
I really hope that someone can help me with this problem.  I have read the faq through several times without any luck and I have also scanned the mailing list with the same result.
 
Thank you,
Ásta

Reply via email to