----------------------------------------------------------------
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 Tyler,
>2. Gave permission to connect to the Xserver from localhost: xhost +
>localhost
Here I wrote to the terminal:
xhost + localhost (check the man pages for more info on the xhost command)
>3. started the Xserver with DISPLAY 0 as an ordinary user
Here I started by setting the environment variable DISPLAY to 0:0 (export
DISPLAY="0:0" .note that you probably have to do this before you run the
xhost command).
then I simply ran startx.
Make sure that your DISPLAY variable is set to "0:0" on the console from
where you run the script that starts the JServ. Also make sure that you run
startx and the JServ startup script as the same user. Also, it does not
work unless you are logged directly on to the host. I tried doing it
through telnet and it didn't work.
This is what solved this problem for me but there are probably some better
solutions out there that don't require you to start the JServ manually!
Hope this will be of use,
Regards,
Ásta
----- Original Message -----
From: Tyler Morrison <[EMAIL PROTECTED]>
To: Java Apache Users <[EMAIL PROTECTED]>
Sent: Wednesday, January 26, 2000 2:44 PM
Subject: Ásta - more details please? Thanks!
> ----------------------------------------------------------------
> 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!!!
> ----------------------------------------------------------------
>
> Ásta - thanks for letting us know how you did this! I don't need to do
this today, but I'm sure I will someday!
>
> Could you provide more details on how you did items 2 and 3 for those of
us new to X (like myself)?
>
> Also, I don't see anything in your script that starts JServ up in Display
0 but perhaps that what step 1 takes care of?
>
> Thanks!
> Tyler
>
> >I just wanted to let you know that I have gotten this to work, finally,
> >thanks to your answers. What I ended up doing was as follows:
> >
> >1. Add the line wrapper.env=DISPLAY=localhost:0 to my jserv.properties
file
> >2. Gave permission to connect to the Xserver from localhost: xhost +
> >localhost
> >3. started the Xserver with DISPLAY 0 as an ordinary user.
> >4. started JServ manually with DISPLAY 0, using the following script:
> >
> >#!/bin/sh
> >properties=/usr/local/jserv/etc/jserv.properties
> >log=/usr/local/jserv/logs/jserv_manual.log
> >CLASSPATH=$CLASSPATH:/usr/local/JSDK2.0/lib/jsdk.jar
> >CLASSPATH=$CLASSPATH:/usr/local/jserv/libexec/ApacheJServ.jar
> >java org.apache.jserv.JServ $properties $1 2>> $log
> >
> >Thank you very much for your help. I will add your answers to the faq as
it
> >might save someone some time.
> >
> >Ásta
> >----- Original Message -----
> >From: Richard Hallier <[EMAIL PROTECTED]>
> >To: Java Apache Users <[EMAIL PROTECTED]>
> >Sent: Monday, January 24, 2000 6:48 PM
> >Subject: RE: Problems with images in servlets (classes not found)
> >
> >
> >> ----------------------------------------------------------------
> >> 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]
> >>
> >
> >
> >
> >--
> >--------------------------------------------------------------
> >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]
>
>
> ------------------------------------------------------
> Tyler Morrison - [EMAIL PROTECTED]
>
>
> --
> --------------------------------------------------------------
> 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]
>
--
--------------------------------------------------------------
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]