Connecting to a remote Tomcat8

Questions about YourKit Java Profiler
Post Reply
tomtobin
Posts: 1
Joined: Mon Jul 20, 2015 4:28 am

Connecting to a remote Tomcat8

Post by tomtobin »

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

Re: Connecting to a remote Tomcat8

Post by Anton Katilin »

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
Post Reply