java-tracing-agent icon indicating copy to clipboard operation
java-tracing-agent copied to clipboard

InvocationTargetException

Open Jordantan1999 opened this issue 2 years ago • 3 comments

I am getting error when running this command java -javaagent:D:\dakaraphi\dakaraphi.devtools.tracing.jar -Ddakaraphi.devtools.tracing.config.file=D:\dakaraphi\tracer.json -jar D:\example.jar

The error message is

TracingAgent: Starting v0.5.1 TracingAgent: classloader: null Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:115) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:560) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:572) Caused by: java.lang.NullPointerException at java.base/java.io.File.<init>(File.java:278) at dakaraphi.devtools.tracing.TracingAgent.premain(TracingAgent.java:34) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)

Jordantan1999 avatar Jan 16 '24 15:01 Jordantan1999

It probably couldn't find the config file. Note, 0.5.1 is old. I would recommend getting the source and building v1.0.9 which is the latest.

d-akara avatar Jan 16 '24 15:01 d-akara

but the jar that I am using dakaraphi.devtools.tracing.jar, was built from the source in git.

Jordantan1999 avatar Jan 24 '24 16:01 Jordantan1999

The source in git would log v1.0.9

https://github.com/d-akara/java-tracing-agent/blob/7bc9a28f72ed018e9550d460d29152f15d9f20fb/dakaraphi.devtools.tracing/src/main/java/dakaraphi/devtools/tracing/TracingAgent.java#L36

d-akara avatar Jan 30 '24 18:01 d-akara