Can anyone help me out of this problem?

52 views
Skip to first unread message

zhaoyu dong

unread,
Mar 7, 2012, 5:19:12 AM3/7/12
to multiverse
I have download the Multiverse souce code and can build the jar file.
But when I write a simple sample code and try to run it. Errors occur:

Multiverse: Starting Multiverse JavaAgent
Multiverse: Optimizations disabled in Javaaagent (see compiletime
instrumentation)
Multiverse: Bugshaker disabled (good performance)
Multiverse: Tracing is disabled (useful for production environment)
Multiverse: Initializing instrumentor
'org.multiverse.stms.alpha.instrumentation.AlphaStmInstrumentor'
Multiverse: Initialized 'AlphaStmInstrumentor-0.6'
Multiverse: All classes are included since nothing explicitly is
configured.
Multiverse: In most cases you want to set it explicitly using the
org.multiverse.javaagent.include System propery.
Multiverse: The following classes are excluded from instrumentation
(exclude overrides includes)
ch.qos.;com.gigaspaces.;com.jprofiler.;com.j_spaces.;com.ibm.;com.intellij.;com.sun.;com.tc.;com.tcclie
nt.;groovy.;java.;javax.;oracle.;org.apache.;org.eclipse.;org.gradle.;org.codehaus.groovy.;org.hamcrest.;org.hibernate.;org.ietf.;org.jboss.;org.jruby.;org.junit.;org.junit.;org.kohsuke.;org.mockito.;
org.mortbay.;org.multiverse.repackaged.;org.multiverse.repackaged.org.objectweb.asm.;org.omg.;org.openspaces.;org.osgi.;org.slf4j.;org.springframework.;org.w3c.;org.xml.;scala.;se.scalablesolutions.;s
un.;sunw.
Multiverse: Multiverse Javaagent started successfully
Mar 07, 2012 6:04:22 PM
org.multiverse.javaagent.MultiverseClassFileTransformer
handleThrowable
SEVERE: Failed while instrumenting class 'Unsafe'. It is not possible
to abort the Javaagent instrumentation process, so the JVM is going to
continue, but since this class is not instrumented, it is not
transactional so all bets are off.
java.lang.NullPointerException
at
org.multiverse.repackaged.org.objectweb.asm.MethodWriter.visitMaxs(Unknown
Source)
at
org.multiverse.repackaged.org.objectweb.asm.tree.MethodNode.accept(Unknown
Source)
at
org.multiverse.repackaged.org.objectweb.asm.tree.MethodNode.accept(Unknown
Source)
at
org.multiverse.repackaged.org.objectweb.asm.tree.ClassNode.accept(Unknown
Source)
at
org.multiverse.instrumentation.asm.AsmUtils.toBytecode(AsmUtils.java:
528)
at
org.multiverse.stms.alpha.instrumentation.transactionalmethod.TransactionalMethodInstrumentationPhase.doInstrument(TransactionalMethodInstrumentationPhase.java:
60)
at
org.multiverse.instrumentation.AbstractInstrumentationPhase.instrument(AbstractInstrumentationPhase.java:
32)
at
org.multiverse.instrumentation.StandardInstrumentor.process(StandardInstrumentor.java:
238)
at
org.multiverse.javaagent.MultiverseClassFileTransformer.transform(MultiverseClassFileTransformer.java:
41)
at sun.instrument.TransformerManager.transform(Unknown Source)
at sun.instrument.InstrumentationImpl.transform(Unknown
Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown
Source)

Mar 07, 2012 6:04:22 PM
org.multiverse.javaagent.JavaAgentProblemMonitor$LoggingDaemon run
SEVERE: STM integrity compromised, instrumentation problems
encountered. Partial instrumented classes could give unexpected
results. Check the logging for the instrumentation exception(s).
List of problem classes: (10 max)
Unsafe

Mar 07, 2012 6:04:22 PM org.multiverse.api.GlobalStmInstance <clinit>
INFO: Initializing GlobalStmInstance using factoryMethod
'org.multiverse.stms.alpha.AlphaStm.createFast'.
Mar 07, 2012 6:04:22 PM org.multiverse.stms.alpha.AlphaStm <init>
INFO: Created a new AlphaStm instance
Mar 07, 2012 6:04:22 PM org.multiverse.api.GlobalStmInstance <clinit>
INFO: Successfully initialized GlobalStmInstance using factoryMethod
'org.multiverse.stms.alpha.AlphaStm.createFast'.
100

My Unsafe.java is as below:

import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.multiverse.api.*;
import static org.multiverse.api.StmUtils.*;
import org.multiverse.annotations.*;
import org.multiverse.transactional.refs.*;

@TransactionalObject
public class Unsafe{
private IntRef m_value = new IntRef();
Random r = new Random(System.currentTimeMillis());

public void setValue(int i){
m_value.set(i);
}

public int getValue(){
return m_value.get();
}

@TransactionalMethod
public void inc(){
int temp = getValue();
try{
Thread.sleep(r.nextInt() % 50 + 50);
}catch(InterruptedException ex){}
setValue(temp + 1);
}

class Changer extends Thread{
public void run(){
for(int i = 0; i < 100; i++){
inc();
}
}
}

public Unsafe(){
Changer c1 = new Changer();
Changer c2 = new Changer();

c1.start();
c2.start();

try{
c1.join();
}catch(InterruptedException ex){}

try{
c2.join();
}catch(InterruptedException ex){}

System.out.println(getValue());
}

public static void main(String[] args){
Unsafe unsafe = new Unsafe();
}
}

My compiling command is :
javac -cp ./multiverse-alpha-0.6-SNAPSHOT.jar Unsafe.java

My running command is :
java -javaagent:multiverse-alpha-0.6-SNAPSHOT.jar -cp . Unsafe

Peter Veentjer

unread,
Mar 7, 2012, 5:34:32 AM3/7/12
to googlemu...@googlegroups.com
Hi Zhaony Dong,

it is trying to instrument the Unsafe class since it is being touched.
But since there is no transactional logic inside this class, it
doesn't matter if this exception is thrown. So for the time being you
can ignore this class.

PS:
I'm about to release the 0.7 release (yes.. it is out there for ages).
This release won't rely anymore on instrumentation.

> --
> You received this message because you are subscribed to the Google Groups "multiverse" group.
> To post to this group, send email to googlemu...@googlegroups.com.
> To unsubscribe from this group, send email to googlemultiver...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/googlemultiverse?hl=en.
>

Reply all
Reply to author
Forward
0 new messages