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

Marco Boniardi wrote:

> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
> I wrote many servlets, with JDBC too, and they run fine on my system.
> They ask me for a Graphic Counter, so I have tried to use for the 1st time
> AWT
> I used an example, GraphicalCounter from servlets.com.
> But I have always the same error:
>
> /usr/local/jdk117/bin/../lib/i586/green_threads/libawt.so: undefined symbol:
> XtShellStrings (libawt.so)
> java.lang.UnsatisfiedLinkError: no awt in shared library path
>  at
> org.apache.jserv.JServConnection.processRequest(JServConnection.java:341)
>  at org.apache.jserv.JServConnection.run(JServConnection.java:197)
>  at java.lang.Thread.run(Thread.java)
>
> But AWT is in Classes.zip, with all the other classes...
>

The AWT classes are in classes.zip, but they use native libraries to interface
with the underlying X-Windows system.  It is the native libraries that are not
being found.

When you run a Java application from the command line, part of what the "java"
script (on Unix platforms) does is sets the LD_LIBRARY_PATH environment
variable to include the directory containing the shared libraries that are
needed.  For instance, if you are using green threads, these libraries would be
found in:

    /usr/local/jdk117/lib/i586/green_threads

But when you ask Apache to start Apache JServ automatically, this environment
variable is neither initialized correctly (for this purpose), nor is it passed
on to Apache JServ.  (You will also need to make sure the DISPLAY variable is
passed on).

There are games you can play with the jserv.properties file to set this all up
right (I haven't done it, so I'm afraid I don't know the details -- maybe
someone else who has done this can comment?), but a simpler approach (IMHO) is
to start Apache JServ manually instead of automatically.  There are
instructions for this in the install documents, and examples in FAQ-O-MATIC.
 But the key reason for doing it here is that your startup script will use the
normal "java" command, so that LD_LIBRARY_PATH gets initialized correctly.

One more thing to check before you get started -- you have to have X-Windows
running on the server that is hosting Apache JServ for this to work (even in
manual mode), even though you are not going to display anything directly on the
screen.  The AWT routines utilize the underlying X-Windows libraries to do the
image creation and manipulation you are talking about.

>
> Marco
>

Craig McClanahan


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

Reply via email to