----------------------------------------------------------------
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've already known this problem. You have to extend access permissions of
the X Server to the user running Apache JServ. As far I am concerned,
setting DISPLAY didn't solve the problem, by default it sould be right. To
correctly understand the problem, if you run the xserver with the user
myuser (startx), and then you run manualy JServ with the same user, it
should be ok.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ásta Herdís
Hall
Sent: lundi 24 janvier 2000 18:44
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]