I got the exception "No local context classloader" exception from the last line in the listing.
#getClassLoader is completely fine, the problem is #getContextClassLoader which is programmed to always return null in JPF
I am not sure if my SUT actually needs #getContextClassLoader for its normal operations. Currently, I am inclined to believe I just had a bad luck to pick a JUnit test which needed this. When I moved to different test, this problem did not arise.
* DELEGATING Unhandled Native -> sun.management.OperatingSystemImpl.initialize
[SEVERE] JPF exception, terminating: exception in native method sun.management.OperatingSystemImpl.initialize
java.lang.UnsatisfiedLinkError: sun.management.OperatingSystemImpl.initialize()V
at sun.management.OperatingSystemImpl.initialize(Native Method)
at sun.management.OperatingSystemImpl.<clinit>(OperatingSystemImpl.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at OTF_JPF_sun_management_OperatingSystemImpl.initialize____V(OTF_JPF_sun_management_OperatingSystemImpl.class)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at gov.nasa.jpf.vm.NativeMethodInfo.executeNative(NativeMethodInfo.java:125)
at gov.nasa.jpf.jvm.bytecode.EXECUTENATIVE.execute(EXECUTENATIVE.java:73)
at gov.nasa.jpf.vm.ThreadInfo.executeInstruction(ThreadInfo.java:1908)
at gov.nasa.jpf.vm.ThreadInfo.executeTransition(ThreadInfo.java:1859)
at gov.nasa.jpf.vm.SystemState.executeNextTransition(SystemState.java:765)
at gov.nasa.jpf.vm.VM.forward(VM.java:1722)
at gov.nasa.jpf.search.Search.forward(Search.java:579)
at gov.nasa.jpf.search.DFSearch.search(DFSearch.java:79)
at gov.nasa.jpf.JPF.run(JPF.java:613)
at gov.nasa.jpf.JPF.start(JPF.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at gov.nasa.jpf.tool.Run.call(Run.java:80)
at gov.nasa.jpf.tool.RunJPF.main(RunJPF.java:116)
---------------------- JPF error stack trace ---------------------
gov.nasa.jpf.JPFNativePeerException: exception in native method sun.management.OperatingSystemImpl.initialize
at gov.nasa.jpf.vm.NativeMethodInfo.executeNative(NativeMethodInfo.java:186)
at gov.nasa.jpf.jvm.bytecode.EXECUTENATIVE.execute(EXECUTENATIVE.java:73)
at gov.nasa.jpf.vm.ThreadInfo.executeInstruction(ThreadInfo.java:1908)
at gov.nasa.jpf.vm.ThreadInfo.executeTransition(ThreadInfo.java:1859)
at gov.nasa.jpf.vm.SystemState.executeNextTransition(SystemState.java:765)
at gov.nasa.jpf.vm.VM.forward(VM.java:1722)
at gov.nasa.jpf.search.Search.forward(Search.java:579)
at gov.nasa.jpf.search.DFSearch.search(DFSearch.java:79)
at gov.nasa.jpf.JPF.run(JPF.java:613)
at gov.nasa.jpf.JPF.start(JPF.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at gov.nasa.jpf.tool.Run.call(Run.java:80)
at gov.nasa.jpf.tool.RunJPF.main(RunJPF.java:116)
Caused by: java.lang.UnsatisfiedLinkError: sun.management.OperatingSystemImpl.initialize()V
at sun.management.OperatingSystemImpl.initialize(Native Method)
at sun.management.OperatingSystemImpl.<clinit>(OperatingSystemImpl.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at OTF_JPF_sun_management_OperatingSystemImpl.initialize____V(OTF_JPF_sun_management_OperatingSystemImpl.class)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at gov.nasa.jpf.vm.NativeMethodInfo.executeNative(NativeMethodInfo.java:125)
... 15 more
The funny thing is that I cannot use the GenPeer tool either:
[jdanek@nixos:~/Work/repos/activemq-artemis/tests/stress-tests/target]$ java -cp ~/workspace/jpf-core/build/main gov.nasa.jpf.tool.GenPeer -s -ci -m sun.management.OperatingSystemImpl > ~/workspace/jpf-core/src/peers/gov/nasa/jpf/vm/JPF_sun_management_OperatingSystemImpl.java
java.lang.UnsatisfiedLinkError: sun.management.OperatingSystemImpl.initialize()V
at sun.management.OperatingSystemImpl.initialize(Native Method)
at sun.management.OperatingSystemImpl.<clinit>(OperatingSystemImpl.java:54)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at gov.nasa.jpf.tool.GenPeer.getClass(GenPeer.java:75)
at gov.nasa.jpf.tool.GenPeer.main(GenPeer.java:64)
I'll try to deal with this new exception tomorrow and post a new thread if I do not succeed on my own.