swarm-support
[Top][All Lists]
Advanced

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

JDK1.3 vs. Kaffe


From: Tee Toth-Fejel
Subject: JDK1.3 vs. Kaffe
Date: Thu, 9 Nov 2000 18:29:05 -0500

There seems to be an incompatibility problem between Kaffe and JDK1.3:

C:\jheatbugs-2.1>javac *.java
HeatbugModelSwarm.java:298: cannot resolve symbol
symbol  : constructor FArgumentsImpl
(HeatbugModelSwarm,swarm.Selector,boolean)
location: class swarm.defobj.FArgumentsImpl
                        new FArgumentsImpl (this, sel, true)));
                        ^
1 error

C:\jheatbugs-2.1>echo %classpath%
.;c:\jdk1.3\jre\lib\rt.jar;c:\jdk1.3\lib\tools.jar;c:\Swarm-2.1.1\share\swar
m\swarm.jar


Also, while I can compile TestMapIndex in JDK1.3, and run it in Kaffe, it's
OK:

address@hidden//c/SwarmSyncer/FlintstoneMM/FredAndWilma] $ javaswarm
TestMapIndex
main: starting initSwarm
main: finished initSwarm, creating TestMapIndex
TestMapIndex: constructor
main: finished TestMapIndex, starting buildActions
main: finished buildActions
address@hidden
swarm.collections.MapIndexImpl
swarm.collections.MapIndexImpl
first event: address@hidden
second event: address@hidden
third event: null


But it won't run in JDK1.3. Specifically:

VM Started: main: starting initSwarm

Exception occurred: java.lang.ClassNotFoundException (uncaught)
thread="main", java.net.URLClassLoad
er$1.run(), line=200, bci=72


What would happen if the swarm.jar was compiled using JDK1.3?
How exactly *is* the swarm.jar produced?

BTW, if I schedule two events at the same time, it crashes even in kaffe:

address@hidden//c/SwarmSyncer/FlintstoneMM/FredAndWilma] $ javaswarm
TestMapIndex
main: starting initSwarm
main: finished initSwarm, creating TestMapIndex
TestMapIndex: constructor
main: finished TestMapIndex, starting buildActions
main: finished buildActions
address@hidden
swarm.collections.MapIndexImpl
swarm.collections.MapIndexImpl
first event: address@hidden
assertion "cls != 0 && name != 0 && sig != 0" failed: file
"/src/kaffe/kaffe/kaffevm/support.c", line 753
      0 [sig] Kaffe 1458 stackdump: Dumping stack trace to
Kaffe.exe.stackdump
address@hidden//c/SwarmSyncer/FlintstoneMM/FredAndWilma] $ less
Kaffe.exe.stackdump
60000348 [main] Kaffe 1458 sig_send: wait for sig_complete event failed, sig
6, rc 258, Win32 error 0

Here is the code I am running with one event per time unit:

import swarm.activity.ScheduleImpl;
import swarm.simtoolsgui.GUISwarmImpl;
import swarm.activity.Schedule;
import swarm.objectbase.SwarmImpl;
import swarm.defobj.Zone;
import swarm.collections.Index;
import swarm.Selector;
import swarm.Globals;

public class TestMapIndex extends SwarmImpl {

  public static void main (String[] args)
    {
    System.out.println ("main: starting initSwarm");
    Globals.env.initSwarm("TestMapIndex", "0.0", "address@hidden",
args);
    System.out.println ("main: finished initSwarm, creating TestMapIndex");
    try
      {
      TestMapIndex obj = new TestMapIndex (Globals.env.globalZone);
      System.out.println("main: finished TestMapIndex, starting
buildActions");
      obj.buildActions ();
      System.out.println("main: finished buildActions");
      obj.test ();
      }
    catch (NoClassDefFoundError ncdferr)
      {
      System.out.println("main: error "+ncdferr);
      ncdferr.printStackTrace();
      }
  }

  Schedule schedule;

  public TestMapIndex (Zone aZone) {
    super (aZone);
    //super ();
    System.out.println("TestMapIndex: constructor");
  }

  public void message1 () {
    System.out.println ("message1");
  }

  public void message2 () {
    System.out.println ("message2");
  }

  public Object buildActions () {
    schedule = new ScheduleImpl (Globals.env.globalZone, true);

    try {
      Selector sel1 = new Selector (getClass (), "message1", false);
      Selector sel2 = new Selector (getClass (), "message2", false);

      schedule.at$createActionTo$message (1, this, sel1);
      schedule.at$createActionTo$message (2, this, sel2);
    } catch (Exception e) {
      e.printStackTrace (System.err);
      System.exit (1);
    }
    return this;
  }

  public void test () {
    Index index = schedule.begin (getZone ());

    System.out.println (index);
    System.out.println (index.getName ());
    System.out.println (index.getName ().toString ());
    System.out.println ("first event: " + index.next ());
    System.out.println ("second event: " + index.next ());
    System.out.println ("third event: " + index.next ());
  }
}


Here is the code I am running with two events during the second time unit:


import swarm.activity.ScheduleImpl;
import swarm.simtoolsgui.GUISwarmImpl;
import swarm.activity.Schedule;
import swarm.objectbase.SwarmImpl;
import swarm.defobj.Zone;
import swarm.collections.Index;
import swarm.Selector;
import swarm.Globals;

public class TestMapIndex extends SwarmImpl {

  public static void main (String[] args)
    {
    System.out.println ("main: starting initSwarm");
    Globals.env.initSwarm("TestMapIndex", "0.0", "address@hidden",
args);
    System.out.println ("main: finished initSwarm, creating TestMapIndex");
    try
      {
      TestMapIndex obj = new TestMapIndex (Globals.env.globalZone);
      System.out.println("main: finished TestMapIndex, starting
buildActions");
      obj.buildActions ();
      System.out.println("main: finished buildActions");
      obj.test ();
      }
    catch (NoClassDefFoundError ncdferr)
      {
      System.out.println("main: error "+ncdferr);
      ncdferr.printStackTrace();
      }
  }

  Schedule schedule;

  public TestMapIndex (Zone aZone) {
    super (aZone);
    //super ();
    System.out.println("TestMapIndex: constructor");
  }

  public void message1 () {
    System.out.println ("message1");
  }

  public void message2 () {
    System.out.println ("message2");
  }

  public void message3 () {
    System.out.println ("message3");
  }

  public Object buildActions () {
    schedule = new ScheduleImpl (Globals.env.globalZone, true);

    try {
      Selector sel1 = new Selector (getClass (), "message1", false);
      Selector sel2 = new Selector (getClass (), "message2", false);
      Selector sel3 = new Selector (getClass (), "message3", false);
      schedule.at$createActionTo$message (1, this, sel1);
      schedule.at$createActionTo$message (2, this, sel2);
      schedule.at$createActionTo$message (2, this, sel3);
    } catch (Exception e) {
      e.printStackTrace (System.err);
      System.exit (1);
    }
    return this;
  }

  public void test () {
    Index index = schedule.begin (getZone ());

    System.out.println (index);
    System.out.println (index.getName ());
    System.out.println (index.getName ().toString ());
    System.out.println ("first event: " + index.next ());
    System.out.println ("second event: " + index.next ());
    System.out.println ("third event: " + index.next ());
  }
}

Tihamer "Tee" Toth-Fejel                    Member of Technical Staff
(734) 623-2544   address@hidden      http://www.erim.org/ 
Center for Electronic Commerce, Environmental Research Institute of Michigan



 

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