Arseni
Arseni

Reputation: 11

JNI Error when instrumenting with OpenTelemetry

I am running this code:

java -javaagent:/path/to/opentelemetry-javaagent.jar -jar /path/to/my/project/out/artifacts/project_jar/project.jar 

While meaning to instrument the code in my project and retrieve some execution data (local vars, their values etc). But I am getting this error:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
    at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:297)
.
.
.
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.net.ConnectException: Connection refused

I am running the project with maven, Java 17, using IntelliJ, and trying to use OpenTelemetry as the java agent.

Commands java -version and javac -version both return 17.

Attaching other agents (e.g. jacoco) seems to work. Whether or not I specify the target -jar makes no difference and returns the same error.

Not sure how best to tackle this error next. Any advise will be appreciated.

Upvotes: 0

Views: 87

Answers (0)

Related Questions