Java application is missing in "Monitor Applications" list

Questions about YourKit Java Profiler
Post Reply
alexraju
Posts: 3
Joined: Mon Sep 06, 2021 3:32 pm

Java application is missing in "Monitor Applications" list

Post by alexraju »

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

[abcuser@atom01 ~]$ 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
[abcuser@atom01 ~]$ 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
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

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

Post by Anton Katilin »

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
alexraju
Posts: 3
Joined: Mon Sep 06, 2021 3:32 pm

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

Post by alexraju »

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.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

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

Post by Anton Katilin »

> 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.
alexraju
Posts: 3
Joined: Mon Sep 06, 2021 3:32 pm

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

Post by alexraju »

I missed that option. I will try the "Other java application" option. Thank you for pointing that out.
Post Reply