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

Hello,

I think Apache and JServ are not the right tools for you. You want to create
an application but this has nothing to do with servlets! 

You must decide if you want to create an application with the standard awt
and a graphical user interface or if you want to use servlets to create
dynamic HTML pages. You can't use awt classes in servlets because you don't
have a desktop where your application is shown. (This is the error with you
X11 window). 

I recommend to read the Java-Tutorial from Sun. There are some examples that
explain how to use servlets .
(http://java.sun.com/docs/books/tutorial/index.html)

Ulrich
> -----Original Message-----
> From: Ásta Herdís Hall [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, January 24, 2000 6:44 PM
> To:   [EMAIL PROTECTED]
> Subject:      Problems with images in servlets (classes not found)
> 
> 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


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