From: Flavio L. <fl...@gm...> - 2007-09-24 14:16:32
|
Hi Jantien, I think the problem is that the class is defined with default visibility. If you add "public" to the definition of your peer class things might work. -Flavio On 9/24/07, Jantien Sessink <jan...@gx...> wrote: > > > > > Hi, > > > > 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. > > > > Kind regards, > > Jantien Sessink > > > > > > -----------------------Model > class------------------------------------------------------ > > package nl.gx.firsthop; > > > > public class Test { > > > > public static void main(String[] args) { > > Integer test = 0; > > System.out.println("test = " + test.toString()); > > > > test = increase(test, 10); > > System.out.println("test = " + test.toString()); > > > > test = decrease(test, 10); > > System.out.println("test = " + test.toString()); > > } > > > > native static int increase(Integer t, int increase); > > > > native static int decrease(Integer t, int decrease); > > } > > ---------------------------------------------------------------------------------------- > > > > -----------------------NativePeer > class------------------------------------------------- > > package nl.gx.firsthop; > > > > import gov.nasa.jpf.jvm.MJIEnv; > > > > class JPF_nl_gx_firsthop_Test { > > > > public static int increase (MJIEnv env, int rcls, int rInteger0, int > v1) { > > System.out.println("Increasing test....."); > > for(int i = 0; i < v1; i++){ > > rInteger0++; > > } > > return rInteger0; > > } > > > > public static int decrease (MJIEnv env, int rcls, int rInteger0, int > v1) { > > System.out.println("Decreasing test....."); > > for(int i = 0; i < v1; i++){ > > rInteger0--; > > } > > return rInteger0; > > } > > > > } > > ---------------------------------------------------------------------------------------- > > > > -----------------------JPF > output------------------------------------------------------- > > JavaPathfinder v4.1 - (C) 1999-2007 RIACS/NASA Ames Research Center > > > > > > ====================================================== > system under test > > application: nl.gx.firsthop.Test.class > > > > ====================================================== > search started: 9/24/07 8:54 AM > > test = 0 > > > > ====================================================== > 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) > > > > > > ====================================================== > trace #1 > > ------------------------------------------------------ > transition #0 thread: 0 > > gov.nasa.jpf.jvm.choice.ThreadChoiceFromSet {>main} > > > > ====================================================== > snapshot #1 > > no live threads > > > > ====================================================== > results > > error #1: gov.nasa.jpf.jvm.NoUncaughtExceptionsProperty > "java.lang.IllegalAccessException: calling nl.gx.fi..." > > > > ====================================================== > search finished: 9/24/07 8:54 AM > > ---------------------------------------------------------------------------------------- > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Javapathfinder-user mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javapathfinder-user > > -- Google Talk: fl...@gm... MSN Messenger: fl...@gm... Skype: flerda |