Re: off screen image

  • Subject: Re: off screen image
  • From: ncubukcu <ncubukcu@xxxxxxxxx>
  • Date: Mon, 07 Aug 2006 09:57:25 -0400
Thank you very much Bill
my exploration on this still continues but at least for now I found a solution to run visad in headless mode. First thing I do is to add
System.setProperty("java.awt.headless", "true");
before I do any visad stuff. This puts it in headles mode for sure.. Apparently calling an offscreen constructor is not enough ( the solution might be as simple as adding this line to one of the off screen constructor). Then I do
DisplayImplJ2D display = new DisplayImplJ2D("display1", xSize,ySize);
which is one of the constructor that works in headless mode. Unfortunately from here on the only thing I can do is to create a buffered image using display.getImage()/getImage(true). I am still trying to see If I can do more with visad rather than just image io. If I can find a way to serialize my visad snippets, then I can make more interactive displays. Sun docs on serialization implies that such things (serialize a code that uses "not serializable" methods/classes) are doable but I just don't know how it works yet. One step at a time:-)
nihat cubukcu
Bill Hibbard wrote:
Hi nc,

It looks to me like the problem is the declaration:

  private static Component DUMMY = null;

in The construction of a JPanel
for this variable is inside a try {...}, but the
declaration itself is probably triggering the

I don't work much with VisAD anymore, but perhaps this
declaration can be changed to Object, with a cast to
Component in the DisplayEvent.getDisplayComponent().
Of course, the declaration of Component as the return
value of this method may be enough to trigger a
NoClassDefFoundError when a DisplayEvent is constructed.
You or someone would have to experiment with this.

My advice would be to see if you can find some changes
to VisAD so that Java2D offscreen rendering will work
on a system without a display. If you can find simple
changes, perhaps one of the VisAD developers will apply
them to the system.

Good luck,

On Wed, 2 Aug 2006, ncubukcu wrote:

if I remotely connect to my visad server and run a test program that
constructs something like following;
DisplayImplJ2D display = new DisplayImplJ2D("display1",300,300);

this is what I get when I run my code;

kCGErrorRangeCheck : Window Server communications from outside of
session allowed for root and console user only
Exception in thread "main" java.lang.NoClassDefFoundError
        at visad.DisplayRenderer.setWaitFlag(
        at visad.DisplayImpl.doAction(
        at visad.java2d.DisplayImplJ2D.doAction(
        at visad.util.ThreadPool$
        at visad.DisplayImpl.clearMaps(
        at visad.java2d.DisplayImplJ2D.clearMaps(
        at visad.DisplayImpl.<init>(
        at visad.java2d.DisplayImplJ2D.<init>(
        at visad.java2d.DisplayImplJ2D.<init>(
        at visad.java2d.DisplayImplJ2D.<init>(
        at CreateImage.main(
*I know why I get this exception.. it want's me to run it in headless
mode or I have to set  display to my local machine.  What I don't
understand is why the off screen constructor above needs a display. Any
idea how I can go around this. I have done all my excercises on a local
machine but now that I need to use remote machine for visad, all my test
cases are failing...

To unsubscribe visad, visit:

To unsubscribe visad, visit:

To unsubscribe visad, visit:

  • 2006 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: