From: Jantien S. <jan...@gx...> - 2007-09-24 07:42:19
|
Hi, =20 Currently I'm looking at the possibility of using Java PathFinder for a research project. I'm testing to run the main class in JPF and some other functions in the host JVM by creating a Model class and a NavtivePeer class. Both classes are printed below, as is the JPF output. When I try to run them in JPF, I get an IllegalAccessException. For some reason, the Model class can't find the functions defined in the NativePeer class. Is there something I forgot to do in order to let the model class see the NativePeer class? I hope you can help me with my problem. =20 Kind regards, Jantien Sessink =20 =20 -----------------------Model class------------------------------------------------------ package nl.gx.firsthop; =20 public class Test { =20 public static void main(String[] args) { Integer test =3D 0; System.out.println("test =3D " + test.toString()); =20 test =3D increase(test, 10); System.out.println("test =3D " + test.toString()); =20 test =3D decrease(test, 10); System.out.println("test =3D " + test.toString()); } =20 native static int increase(Integer t, int increase); =20 native static int decrease(Integer t, int decrease); } ------------------------------------------------------------------------ ---------------- =20 -----------------------NativePeer class------------------------------------------------- package nl.gx.firsthop; =20 import gov.nasa.jpf.jvm.MJIEnv; =20 class JPF_nl_gx_firsthop_Test { =20 public static int increase (MJIEnv env, int rcls, int rInteger0, int v1) { System.out.println("Increasing test....."); for(int i =3D 0; i < v1; i++){ rInteger0++; } return rInteger0; } =20 public static int decrease (MJIEnv env, int rcls, int rInteger0, int v1) { System.out.println("Decreasing test....."); for(int i =3D 0; i < v1; i++){ rInteger0--; } return rInteger0; } =20 } ------------------------------------------------------------------------ ---------------- =20 -----------------------JPF output------------------------------------------------------- JavaPathfinder v4.1 - (C) 1999-2007 RIACS/NASA Ames Research Center =20 =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D system under test application: nl.gx.firsthop.Test.class =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D search started: 9/24/07 8:54 AM test =3D 0 =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D error #1 gov.nasa.jpf.jvm.NoUncaughtExceptionsProperty java.lang.IllegalAccessException: calling nl.gx.firsthop.Test.increase at nl.gx.firsthop.Test.increase(Native Method) at nl.gx.firsthop.Test.main(Test.java:9) =20 =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D trace #1 ------------------------------------------------------ transition #0 thread: 0 gov.nasa.jpf.jvm.choice.ThreadChoiceFromSet {>main} =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D snapshot #1 no live threads =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D results error #1: gov.nasa.jpf.jvm.NoUncaughtExceptionsProperty "java.lang.IllegalAccessException: calling nl.gx.fi..." =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D search finished: 9/24/07 8:54 AM ------------------------------------------------------------------------ ---------------- |