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

Connecting to a remote Tomcat8

Moderators: Vladimir Kondratyev, Anton Katilin

Connecting to a remote Tomcat8

Postby tomtobin » Mon Jul 20, 2015 4:39 am

Hi, trying to remotely connect to an app on Tomcat 8. Followed the directions to do a yjp -integrate, but my version of tomcat does not have a startup.sh - it's only launched from a service. This is on RedHat at AWS.

Doing a yjp -attach doesn't find my running tomcat instance, and when I put the PID in directly I get the following...

Enter PID of the application you want to attach (0 to exit) and press Enter:
>11245
Please specify comma-separated list of startup options, or press Enter for default options (recommended):
>
Attaching to process 11245 using options
com.yourkit.runtime.PresentableException: Cannot attach profiler agent to JVM as to a 32-bit process:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/sun/tools/attach/AgentInitializationException : Unsupported major.minor version 52.0

Cannot attach profiler agent to JVM as to a 64-bit process:

java.io.IOException: Operation not permitted
at com.yourkit.g.u.q.a(a:31)
at com.yourkit.g.u.c.a(a:153)
at com.yourkit.Main1.for(a:222)
at com.yourkit.Main1.entry(a:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.yourkit.Main$2.run(a:16)

Attach to a running JVM failed.

Solution: start JVM with the profiler agent instead of attaching it to a running JVM:
https://www.yourkit.com/docs/java/help/ ... ofiler.jsp

Thanks.
tomtobin
 
Posts: 1
Joined: Mon Jul 20, 2015 4:28 am

Re: Connecting to a remote Tomcat8

Postby Anton Katilin » Thu Jul 23, 2015 1:45 pm

Hi,

Followed the directions to do a yjp -integrate, but my version of tomcat does not have a startup.sh - it's only launched from a service.
Please use the wizard's "Generic server" option. This will generate appropriate Java option to be manually specified to load the agent on start. This is the recommended approach.

Anyway, if you still prefer the attach mode, please note that it works under the same user only: you should run "yjp -attach" under the same user as you run the service.

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


Return to Java Profiler

Who is online

Users browsing this forum: No registered users and 12 guests

cron