swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FATAL ERROR! - help


From: Marcus G. Daniels
Subject: Re: FATAL ERROR! - help
Date: 05 Oct 1999 14:33:56 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "MN" == Murali Nandula <address@hidden> writes:

MN> FATAL ERROR in native method: Null object passed to a non-static
MN> method at swarm.simtoolsgui.GUISwarmImpl.go(Native Method) at
MN> StartMisscan.main (StartMisscan.java:16)

You can get a backtrace like so:

$ JAVASWARMGDB=gdb javaswarm StartMisscan
(gdb) run
(gdb) bt

Here's a working GUISwarm test case.. maybe you can see something different
between it and yours?

import swarm.defobj.Zone;
import swarm.activity.Schedule;
import swarm.activity.ScheduleImpl;
import swarm.activity.Activity;
import swarm.objectbase.Swarm;
import swarm.simtoolsgui.GUISwarm;
import swarm.simtoolsgui.GUISwarmImpl;
import swarm.Selector;
import swarm.Globals;

public class TestGUISwarm extends GUISwarmImpl {
  Schedule schedule;
  Schedule stopSchedule;
  
  TestGUISwarm () {
    super (Globals.env.globalZone);
  }

  public void move () {
    System.out.println ("Moving at: " + Globals.env.getCurrentTime ());
  }

  public void stopRunning () {
    getControlPanel ().setStateStopped ();
  }
  
  public Object buildActions () {
    schedule = new ScheduleImpl (this, 5);
    stopSchedule = new ScheduleImpl (this, true);
    
    try {
      Selector moveSel = new Selector (getClass (), "move", false);
      Selector stopSel = new Selector (getClass (), "stopRunning", false);

      schedule.at$createActionTo$message (1, this, moveSel);
      stopSchedule.at$createActionTo$message (100, this, stopSel);
    } catch (Exception e) {
      e.printStackTrace (System.err);
    }
    return this;
  }
  
  public Activity activateIn (Swarm swarmContext) {
    super.activateIn (swarmContext);
    
    schedule.activateIn (this);
    stopSchedule.activateIn (this);
    return getActivity ();
  }

  public static void main (String[] args) {
    Globals.env.initSwarm ("TestGUISwarm",
                           "2.0.1", "address@hidden",
                           args);
    GUISwarm guiSwarm = new TestGUISwarm ();

    guiSwarm.buildObjects ();
    guiSwarm.buildActions ();
    guiSwarm.activateIn (null);
    guiSwarm.go ();
  }
}

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]