Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

InternalError in Unix (createImage() without X)?

3 views
Skip to first unread message

Jason Dorn

unread,
Mar 17, 1998, 3:00:00 AM3/17/98
to

This is a new one for me. First the error:

java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
the
value of the DISPLAY variable.
at sun.awt.motif.MToolkit.<init>(MToolkit.java:41)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:191)
at java.awt.Window.getToolkit(Window.java:155)
at java.awt.Frame.addNotify(Frame.java:82)
at java.awt.Window.show(Window.java:106)
at Test.main(Test.java:9)

The application takes a bunch of parameters, creates a virtual image, draws
to that image and encodes that image as a GIF. It ran fine on my NT
machine but I get this error when moving the app to a Unix box. Here's my
theory:

Because I'm running this from the command line and there is no X-server
running, the app chokes when it tries to create the frame I use to create
the image. That makes sense no?

If I'm right, how can I create and manipulate this image without an
X-server?

-----------------------------------------
Jason Dorn
Senior Advisor
Information Technology Services
University of Colorado, Boulder
jd...@colorado.edu
303-492-5465


Harco de Hilster

unread,
Mar 19, 1998, 3:00:00 AM3/19/98
to Jason Dorn

Jason Dorn wrote:

> This is a new one for me. First the error:
>
> java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
> the
> value of the DISPLAY variable.
> at sun.awt.motif.MToolkit.<init>(MToolkit.java:41)
> at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:191)
> at java.awt.Window.getToolkit(Window.java:155)
> at java.awt.Frame.addNotify(Frame.java:82)
> at java.awt.Window.show(Window.java:106)
> at Test.main(Test.java:9)
>
> The application takes a bunch of parameters, creates a virtual image, draws
> to that image and encodes that image as a GIF. It ran fine on my NT
> machine but I get this error when moving the app to a Unix box. Here's my
> theory:
>
> Because I'm running this from the command line and there is no X-server
> running, the app chokes when it tries to create the frame I use to create
> the image. That makes sense no?
>
> If I'm right, how can I create and manipulate this image without an
> X-server?
>

You can't.
Even offscreen images use the native toolkit. On NT this is always
available. On unix you really need an xserver. You could try to run a vfb xserver
(virtual frame buffer, does not require actual display hardware).
An other solution would be to add the gd package through jni, but then you won't
be able to use the awt graphics.

Regards,

Harco

--
-----------------+----------------------+------------------------------
Harco de Hilster CAOS/CAMM Center Phone: +31(0)24-3653379
Research & University of Nijmegen Fax: +31(0)24-3652977
Development Toernooiveld 1 E-mail: har...@caos.kun.nl
System Management 6525 ED Nijmegen URL: http://www.caos.kun.nl
The Netherlands
-----------------+----------------------+------------------------------


friend

unread,
Mar 20, 1998, 3:00:00 AM3/20/98
to

That maybe the problem (no graphical interface). If so, you can still
manipulate the image, just can't graphically display it,
you have to print the info out as text, dump it to a file, or write the
stuff down (the new image) into a gif file. there are free codes
on web somewhere that do such a thing, you have to find them out, I
don't know where, but I think in one of the FAQ of java somewhere. Good
luck.

Vy

0 new messages