You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run btrace in k8s pod and met the following error:
./btrace -u 9 ../samples/AllCalls1.java (9 is target process's pid, AllCalls1.java is source file name)
btrace INFO: Attaching BTrace to PID: 9
Exception in thread "main" java.lang.NullPointerException
at org.openjdk.btrace.compiler.Compiler.(Compiler.java:66)
at org.openjdk.btrace.compiler.Compiler.(Compiler.java:71)
at org.openjdk.btrace.client.Client.compile(Client.java:208)
at org.openjdk.btrace.client.Client.compile(Client.java:193)
at org.openjdk.btrace.client.Main.main(Main.java:239)
I've search similar issue in the issues search box,but it didn't fix my problem;Can you help me out?
Enviroment information:
Java version:
java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2~bpo8+1-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
It is indeed the tools.jar related issue. Are you sure you put the jar in the correct place? The required location is $JAVA_HOME/lib/tools.jar.
If the things are not working even after the jar file is in the correct place you could compile the script on a machine with full JDK with btracec command and then use the compiled version in btrace ... command.
I run btrace in k8s pod and met the following error:
./btrace -u 9 ../samples/AllCalls1.java (9 is target process's pid, AllCalls1.java is source file name)
btrace INFO: Attaching BTrace to PID: 9
Exception in thread "main" java.lang.NullPointerException
at org.openjdk.btrace.compiler.Compiler.(Compiler.java:66)
at org.openjdk.btrace.compiler.Compiler.(Compiler.java:71)
at org.openjdk.btrace.client.Client.compile(Client.java:208)
at org.openjdk.btrace.client.Client.compile(Client.java:193)
at org.openjdk.btrace.client.Main.main(Main.java:239)
I've search similar issue in the issues search box,but it didn't fix my problem;Can you help me out?
Enviroment information:
Java version:
java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2~bpo8+1-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
brace version:
./btrace --version
BTrace v.2.2.2 (c8f81cc)
scritp content
cat ../samples/AllCalls1.java
....
@btrace
public class AllCalls1 {
@OnMethod(clazz = "demo.tcloud.triblewood.qcbm.favorites.service.FavoriteServiceImpl", method = "/./",
location = @location(value = Kind.CALL, clazz = "/./", method = "/.*/"))
public static void m(@self Object self, @TargetMethodOrField String method, @ProbeMethodName String probeMethod) { // all calls to the methods with signature "()"
println(method + " in " + probeMethod);
}
}
target method file
https://github.com/TencentCloud/container-demo/blob/main/qcbm/qcbm-backend/favorites-service/src/main/java/demo/tcloud/triblewood/qcbm/favorites/service/FavoriteServiceImpl.java
tools.jar
tools.jar is from:https://github.com/Tencent/TencentKona-8/releases/download/8.0.10-GA/TencentKona8.0.10.b1_jdk_linux-x86_64_8u332.tar.gz
The text was updated successfully, but these errors were encountered: