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

Java application is missing in "Monitor Applications" list

Moderators: Vladimir Kondratyev, Anton Katilin

Java application is missing in "Monitor Applications" list

Postby alexraju » Mon Sep 06, 2021 3:43 pm

I'm getting Internal Error message under the Monitor Applications section when trying to Profile a remote Java application.

This is what I found from the log files.

Code: Select all
21.3-231 3.658: com.yourkit.ab.a.e: SSH controller:
  cmd: java -cp .yjp/2021.3-b231/lib/yjp-remote-attach.jar -Dfile.encoding=UTF-8 -Dyk.logger.stdErrOnly=true com.yourkit.Main -host-server
  request: getVmInfos
  exit code: 1
  stderr:
   |Exception in thread "main" java.lang.ExceptionInInitializerError
   |   at com.yourkit.attach.e.<clinit>(a:23)
   |   at com.yourkit.ab.b.a.a(a:51)
   |   at com.yourkit.ab.b.a.a(a:37)
   |   at com.yourkit.ab.b.a.main(a:28)
   |   at com.yourkit.Main.f(a:295)
   |   at com.yourkit.Main.main(a:149)
   |Caused by: java.lang.RuntimeException: Cannot load /home/abcuser/.yjp/2021.3-b231/bin/linux-x86-64/libyjpagent.so
   |If you are using the profiler API, make sure you add to the CLASSPATH the yourkit.jar from entire YourKit Java Profiler installation (<profiler directory>/lib/yourkit.jar), but not a copy of yourkit.jar placed to arbitrary directory.
   |
   |   at com.yourkit.Natives.j(a:61)
   |   at com.yourkit.Natives.<clinit>(a:28)
   |   ... 6 more
   |Caused by: java.lang.UnsatisfiedLinkError: /home/abcuser/.yjp/2021.3-b231/bin/linux-x86-64/libyjpagent.so: /home/abcuser/.yjp/2021.3-b231/bin/linux-x86-64/libyjpagent.so: failed to map segment from shared object: Operation not permitted
   |   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   |   at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
   |   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1817)
   |   at java.lang.Runtime.load0(Runtime.java:810)
   |   at java.lang.System.load(System.java:1086)
   |   at com.yourkit.Natives.j(a:41)
   |   ... 7 more


Also Sharing the file access details.
Code: Select all
[[email protected] ~]$ ls -la .yjp/2021.3-b231/lib/yjp-remote-attach.jar
-rw-r----- 1 abcuser abcgroup 473490 Sep  6 06:06 .yjp/2021.3-b231/lib/yjp-remote-attach.jar
[[email protected] ~]$ ls -la /home/abcuser/.yjp/2021.3-b231/bin/linux-x86-64/libyjpagent.so
-rw-r----- 1 abcuser abcgroup 5155728 Sep  6 06:06 /home/abcuser/.yjp/2021.3-b231/bin/linux-x86-64/libyjpagent.so
alexraju
 
Posts: 3
Joined: Mon Sep 06, 2021 3:32 pm

Re: Java application is missing in "Monitor Applications" li

Postby Anton Katilin » Mon Sep 06, 2021 4:01 pm

We've never seen such problem before. Googling by the error message "java.lang.UnsatisfiedLinkError: failed to map segment from shared object: Operation not permitted" suggests that there might be a problem with your /tmp directory. Some people suggest to remount /tmp with the command "sudo mount /tmp -o remount,exec".

If this does not help could you please provide detail on your setup. In particular, does the remote process run inside a docker container?

Please note that alternatively to attaching the agent to a running JVM you can start the JVM with the agent. Please see:
https://www.yourkit.com/docs/java/help/ ... remote.jsp
https://www.yourkit.com/docs/java/help/agent.jsp
Docker specific instructions:
https://www.yourkit.com/docs/java/help/docker.jsp
Anton Katilin
 
Posts: 6064
Joined: Wed Aug 11, 2004 8:37 am

Re: Java application is missing in "Monitor Applications" li

Postby alexraju » Mon Sep 06, 2021 4:13 pm

Thank you for replying. I don't think the /tmp directory has much role in the setup. Mine is not running in a docker container. I will try the alternative approaches suggested in your reply. Thank you.
alexraju
 
Posts: 3
Joined: Mon Sep 06, 2021 3:32 pm

Re: Java application is missing in "Monitor Applications" li

Postby Anton Katilin » Mon Sep 06, 2021 4:32 pm

> I will try the alternative approaches suggested in your reply

All of them imply adding an appropriate -agentpath JVM parameter to load the agent.

The manual path ( https://www.yourkit.com/docs/java/help/agent.jsp ) requires you to compose -agentpath manually.

The wizard ( https://www.yourkit.com/docs/java/help/ ... remote.jsp ) helps to generate it automatically by choosing the "Other Java application" option.
Anton Katilin
 
Posts: 6064
Joined: Wed Aug 11, 2004 8:37 am

Re: Java application is missing in "Monitor Applications" li

Postby alexraju » Mon Sep 06, 2021 4:56 pm

I missed that option. I will try the "Other java application" option. Thank you for pointing that out.
alexraju
 
Posts: 3
Joined: Mon Sep 06, 2021 3:32 pm


Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron

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.