-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------

anton wrote:
> 
> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
> 
> i am trying to run the example 6.1 from the hunter's book (o'reilly)
> that generates the image using java.awt and then encodes it into gif
> using Acme's GifEncoder.
> 
> as hunter mentioned in his book, for unix clients "the frame has to be
> created inside of X11 server and the webserver has to be granted access
> to X server"
> 
> when i run the code from the example, i get the error message about the
> servlet engine failing to connect to X server. something along the lines
> of "ajp11: Servlet Error: java.lang.InternalError: Can't connect to X11
> window server using 'somehost:0' as the value of the DISPLAY variable."
> 
> could someone share the steps to set up X and jserv to make the script
> work.
> 
> i am using apache 1.3.6 w/ jserv linked as dso running on red hat 5.2
> with jdk 1.7 and jserv 1.0
> 
> i have tried both starting the jserv engine with a script (as someone
> mentioned in faq; ApJServManual was set to on):
> 
> -----------------------
> #!/bin/sh
> # launch jserv in manual mode
> jsdk=/usr/local/java/jsdk/lib/jsdk.jar
> jserv=/usr/local/java/jserv/lib/ApacheJServ.jar
> props=/usr/local/apache/conf/jserv.properties
> log=/usr/local/apache/logs/jserv.log
> classes=$jsdk:$jserv:/usr/local/java/jdk/lib/classes.zip:/usr/local/java/lib/Acme.jar
> 
> DISPLAY=drwho:0
> export DISPLAY
> 
> #THREADS_FLAG=native
> #export THREADS_FLAG
> /usr/local/java/jdk/bin/java  -classpath $classes org.apache.jserv.JServ
> $props &> $log
> ---------------------------
> 
> [once again - what should the value of display variable be (same as
> HOSTNAME?)]
> 
> also i have tried to start jserv together with apache (ApJServManual
> Off) and i have tried to set
>         wrapper.env=DISPLAY=drwho:0
> to set environmental variables together with
>         wrapper.env.copyall=true
> 
> the results were the same.
> 
> thanks
> 
> =anton=
> 
> --
> --------------------------------------------------------------
> 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]

We've recently run into this problem also.  In a production setting the
servers don't always X (why waste 8-16 MB of ram when you don't even have
a monitor?) and run the JDK without the statically linked motif.  The best
solution appears to actually constuct the gif's without using AWT.  Does 
anyone know of java-only gif construction library?

Chree
-- 
Chree Haas  <[EMAIL PROTECTED]>
worldweb.net    (703) 838-2002 x115


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