Yourkit profiler not starting up with docker adoptopenjdk

Questions about YourKit Java Profiler
Post Reply
tbohnen
Posts: 3
Joined: Thu Aug 01, 2019 10:03 am

Yourkit profiler not starting up with docker adoptopenjdk

Post by tbohnen »

Hi

I'm getting the following error when trying to run YourKit agent within docker:

Code: Select all

Error opening zip file or JAR manifest missing : /usr/local/YourKit-JavaProfiler-2019.1/bin/linux-x86-64/libyjpagent.so
Error occurred during initialization of VM
agent library failed to init: instrument
Running Docker image: FROM adoptopenjdk:11.0.3_7-jre-hotspot-bionic

Not sure what I'm doing wrong.

Extra info:

Code: Select all

ldd libyjpagent.so
	linux-vdso.so.1 (0x00007fff97c6e000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd8b2245000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8b2041000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd8b1ca3000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8b18b2000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd8b29f1000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8b1693000)
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit profiler not starting up with docker adoptopenjd

Post by Anton Katilin »

What is the platform ("uname -a")?
What is the output of "java -version"?
Error opening zip file or JAR manifest missing
The error message is strange, it looks like the JVM wants to open the agent library as a ZIP/JAR which is wrong. How do you specify the agent in command line? It should be -agentpath:<path to .so>, and it should be among other JVM options like -Xmx or -D.

See profiling in docker instructions for detail:
https://www.yourkit.com/docs/java/help/docker.jsp
tbohnen
Posts: 3
Joined: Thu Aug 01, 2019 10:03 am

Re: Yourkit profiler not starting up with docker adoptopenjd

Post by tbohnen »

Thanks. I used the docker links as reference. Just to add, I'm running in k8s but don't think that will make a difference. It could be a typo but I checked and it isn't. I've also confirmed that the agent is in that path.

This is my command:

Code: Select all

java -javaagent:/usr/local/YourKit-JavaProfiler-2019.1/bin/linux-x86-64/libyjpagent.so=port=10001,listen=all -cp run.ja org....
Ilya Kalikin
Posts: 16
Joined: Mon Jun 12, 2017 3:06 pm

Re: Yourkit profiler not starting up with docker adoptopenjd

Post by Ilya Kalikin »

The command should be:

Code: Select all

java -agentpath:/usr/local/YourKit-JavaProfiler-2019.1/bin/linux-x86-64/libyjpagent.so=port=10001,listen=all -cp run.ja org....
Note agentpath instead of javaagent. Please refer to this help topic.
tbohnen
Posts: 3
Joined: Thu Aug 01, 2019 10:03 am

Re: Yourkit profiler not starting up with docker adoptopenjd

Post by tbohnen »

Thanks. I'm changing from another agent and obviously didn't check that that was the same. Works now :-)
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit profiler not starting up with docker adoptopenjd

Post by Anton Katilin »

Thank you for the confirmation.
Post Reply