JavaMOP Tips

From FSL
Jump to: navigation, search

Instrumenting with Xbootclasspath can lead to errors if the right jar files are not passed to the java command after weaving. For example, one may see the following error message when running something with Xbootclasspath:

Error occurred during initialization of VM
java.lang.NoSuchMethodError: sun.misc.JavaLangAccess.registerShutdownHook(ILjava/lang/Runnable;)V
    at java.io.Console.<clinit>(Console.java:493)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.misc.SharedSecrets.getJavaIOAccess(SharedSecrets.java:93)
    at java.lang.System.initializeSystemClass(System.java:1089)


The minimum necessary (for JDK 1.6.0.24 on a Linux OS) is -Xbootclasspath/p:directoryWithInstrumentedJRE:/usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/rt.jar

Personal tools
Namespaces

Variants
Actions
Navigation