Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Manifest

Moderators: Vladimir Kondratyev, Anton Katilin

Manifest

Postby efecan » Thu Jul 18, 2019 7:16 am

Hi,

I am trying to use yourkit docker java profiler 2019.1.

I have followed the instructions to build my docker image with profiler, and it works as it is supposed to be. However, when application tries to read manifest file, which has been created by maven-jar-plugin, it reads manifest file of /tmp/yjp<date>.jar.

Is there any way to tell yourkit agent to save original manifest file?

YourKit Java Profiler (docker) : 2019.1
jdk: 1.8.0_181
os: Alpine Linux
efecan
 
Posts: 2
Joined: Thu Jul 18, 2019 7:05 am

Re: Manifest

Postby Anton Katilin » Thu Jul 18, 2019 8:05 am

Hello,

This seems an unknown issue. The JAR file /tmp/yjp<date>.jar contains profiler supporting Java classes, the profiler agent opens it but its manifest should not affect anything to my understanding.

How do you launch the profiled application? What is the command line?

Could you please send the profiler agent log file ~/.yjp/log/<session name>-<pid>.log to support@yourkit.com

Best regards,
Anton
Anton Katilin
 
Posts: 5826
Joined: Wed Aug 11, 2004 8:37 am

Re: Manifest

Postby Anton Katilin » Thu Jul 18, 2019 8:13 am

Update:

However, when application tries to read manifest file, which has been created by maven-jar-plugin, it reads manifest file of /tmp/yjp<date>.jar.

Does your application contain a code which explicitly reads the manifest, e.g. as a resource?

Normally, JAR file manifest is used for executable JARs to specify the entry point and other properties. The profiler's JAR in /tmp is not an executable JAR.
Anton Katilin
 
Posts: 5826
Joined: Wed Aug 11, 2004 8:37 am

Re: Manifest

Postby efecan » Thu Jul 18, 2019 8:32 am

Thanks for fast reply,

Actually I have managed to access my manifest. I had been trying to reach first resource under "META-INF/MANIFEST.MF"

getClassLoader.getResourceAsStream("META-INF/MANIFEST.MF") -> this code finds the manifest of profiler agent jar in tmp directory.

But changing this line with this, getClassLoader().getResources("META-INF/MANIFEST.MF") and iterating over enumeration gives my desired manifest.

Command line,
java <some java options> -agentpath:<path to libyjpagent.so>,listen=all,delay=1000 -jar main.jar

Best regards,

Efecan
efecan
 
Posts: 2
Joined: Thu Jul 18, 2019 7:05 am

Re: Manifest

Postby Anton Katilin » Thu Jul 18, 2019 9:12 am

Hello Efecan,

So it's a classloading issue. The temp JAR is added to bootclasspath, so contributes the first resource by name.

Best regards,
Anton
Anton Katilin
 
Posts: 5826
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 21 guests

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.