Robbie Baldock wrote:
> 
> Nathan Meyers wrote:
> 
> > No, this won't work.
> 
> I didn't think it would!
> 
> > Environment variables are associated with Unix processes and passed to
> > child processes. You can't really set one "just for the servlet", you need
> > to set it for the Unix process under which the servlet is running -
> > meaning the JVM.
> 
> But isn't this a bit crap?  I mean, does this mean that all java
> processes running on a Linux box (whether they be servlets or
> applications) have to share the same DISPLAY settings?!

Not all processes. But all applications running under a particular JVM.

Standalone apps tend to run under their own JVM, servlets all run under
one JVM (a cause of huge time and resource savings). Given your
particular problem, it sounds like this may not be such a bad fit...
unless you've got a compelling need to be opening *different* X servers
from your various servlets. Basically, what happens is your first use of
the AWT opens a connection to the X server, and all graphical activity
from all servlets use that server.

It's a bit crap, but not total crap. It's possible, though not common,
for an X application to open and use more than one display. Java, in its
lowest-common-denominator GUI model, denies you this model -- slightly
annoying. It also denies you any avenue, other than an environment
variable you can't control from Java, for specifying the display you
want to use: that *is* crap.


> 
> >> java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment
> >> at java.lang.Class.forName0(Native Method)
> > You're right, that's not the message you'd see with an unset DISPLAY
> > variable. That class should be in rt.jar... I wonder why you're not
> > finding it.
> 
> Mmm indeed!  Oh dear, this process seems to be a never-ending
> journey of fixing one problem and then crashing into another brick
> wall!

I'll be tackling some servlet projects in a few weeks... I may have more
insight then into why the AWT interface to X seems to be AWOL. Of
course, there's probably someone reading this who already knows the
answer :-).

Nathan


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to