Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException #349

Closed
FlashLightNing opened this issue Jul 19, 2018 · 2 comments

Comments

@FlashLightNing
Copy link

Hi,when I use btrace in debug mode,I met some errors

client:

DEBUG: accepting classpath /home/admin/xsea/lib/loadcontroller-model-1.1-SNAPSHOT.jar
DEBUG: assuming default port 2020
DEBUG: compiling ThreadStart.java
DEBUG: compiled ThreadStart.java
DEBUG: attaching to 19660
DEBUG: checking port availability: 2020
DEBUG: attached to 19660
DEBUG: loading /home/admin/btrace/build/btrace-agent.jar
DEBUG: agent args: port=2020,statsd=,debug=true,bootClassPath=/home/admin/xsea/lib/loadcontroller-model-1.1-SNAPSHOT.jar,systemClassPath=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/../lib/tools.jar,probeDescPath=.
DEBUG: loaded /home/admin/btrace/build/btrace-agent.jar
DEBUG: registering shutdown hook
DEBUG: registering signal handler for SIGINT
DEBUG: submitting the BTrace program
DEBUG: opening socket to 2020
DEBUG: setting up client settings
DEBUG: sending instrument command: []
DEBUG: entering into command loop
DEBUG: received com.sun.btrace.comm.RenameCommand@43bd930a
DEBUG: received com.sun.btrace.comm.OkayCommand@33723e30

Server:

btrace DEBUG: got instrument command
btrace DEBUG: loading BTrace class
btrace DEBUG: verifying BTrace class ...
btrace DEBUG: BTrace class com.sun.btrace.samples.ThreadStart$1 verified
btrace DEBUG: preprocessing BTrace class com.sun.btrace.samples.ThreadStart$1 ...
btrace DEBUG: ... preprocessed
btrace DEBUG: Template: com.perfma.loadcontroller.core.service.impl.MachineServiceImpl -> com.perfma.loadcontroller.core.service.impl.MachineServiceImpl
btrace DEBUG: Template: heartbeat -> heartbeat
btrace DEBUG: loaded 'com.sun.btrace.samples.ThreadStart$1' successfully
btrace DEBUG: class renamed to com.sun.btrace.samples.ThreadStart$1
btrace DEBUG: client com.sun.btrace.samples.ThreadStart$1: got com.sun.btrace.comm.RenameCommand@1e0972f7
btrace DEBUG: creating BTraceRuntime instance for com.sun.btrace.samples.ThreadStart$1
btrace DEBUG: created BTraceRuntime instance for com.sun.btrace.samples.ThreadStart$1
btrace DEBUG: sending Okay command
btrace DEBUG: client com.sun.btrace.samples.ThreadStart$1: got com.sun.btrace.comm.OkayCommand@33ad250
btrace DEBUG: about to defineClass com/sun/btrace/samples/ThreadStart$1
btrace DEBUG: defineClass succeeded for com.sun.btrace.samples.ThreadStart$1
btrace DEBUG: starting client command handler thread
btrace DEBUG: new Client created com.sun.btrace.agent.RemoteClient@6a10c030
btrace DEBUG: retransforming loaded classes
btrace DEBUG: filtering loaded classes
btrace DEBUG: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at com.sun.btrace.agent.Main.startServer(Main.java:673)
	at com.sun.btrace.agent.Main.access$000(Main.java:63)
	at com.sun.btrace.agent.Main$2.run(Main.java:128)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException
	at com.sun.btrace.org.objectweb.asm.ClassReader.<init>(Unknown Source)
	at com.sun.btrace.org.objectweb.asm.ClassReader.<init>(Unknown Source)
	at com.sun.btrace.org.objectweb.asm.ClassReader.<init>(Unknown Source)
	at com.sun.btrace.runtime.BTraceClassReader.<init>(BTraceClassReader.java:102)
	at com.sun.btrace.runtime.ClassInfo.loadExternalClass(ClassInfo.java:265)
	at com.sun.btrace.runtime.ClassInfo.<init>(ClassInfo.java:215)
	at com.sun.btrace.runtime.ClassCache.get(ClassCache.java:70)
	at com.sun.btrace.runtime.ClassCache.get(ClassCache.java:62)
	at com.sun.btrace.runtime.ClassCache.get(ClassCache.java:51)
	at com.sun.btrace.agent.Client.retransformLoaded(Client.java:461)
	at com.sun.btrace.agent.Main$3.run(Main.java:692)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	... 1 more
btrace DEBUG: waiting for clients

Here is my script

package com.sun.btrace.samples;
import com.sun.btrace.BTraceUtils;
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
import com.perfma.loadcontroller.model.Machine;
/*
 * This BTrace script inserts a probe into
 * method entry of java.lang.Thread.start() method.
 * At each Thread.start(), it raises a DTrace probe
 * in addition to printing the name of the thread.
 * A D-script like jthread.d may be used to get the
 * associated DTrace probe events.
 */
@BTrace public class ThreadStart {
    @OnMethod(
        clazz="com.perfma.loadcontroller.core.service.impl.MachineServiceImpl",
        method="heartbeat",
location = @Location(Kind.ENTRY)
    )
    public static void onnewThread(@Self Object t,Machine m) {
	BTraceUtils.jstack();       
// D.probe("jthreadstart", Threads.name(t));
        //println("starting " + Threads.name(t));
    }
}

And my cmd:

./bin/btrace  -cp ~/xsea/lib/loadcontroller-model-1.1-SNAPSHOT.jar -v 19660 ThreadStart.java

where is the problem?

@jbachorik
Copy link
Collaborator

What is the Java version?

@FlashLightNing
Copy link
Author

it is openjdk version "1.8.0_171"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants