ClassNotFoundException when attaching to local process

Questions about YourKit Java Profiler
Post Reply
yannick
Posts: 3
Joined: Tue Apr 21, 2015 4:08 pm

ClassNotFoundException when attaching to local process

Post by yannick »

Hello !

I'm trying to attach Yourkit to a local JBoss server and getting a ClassNotFoundException: com.yourkit.runtime.Callback on the server. The JBoss is not started with Yourkit agent.

What I want to do is CPU profiling.

I understand I could add Yourkit classes to the classpath of the server.

But I'm wondering if there is a way to attach Yourkit to a process without doing any instrumentation, like I reckon JConsole or JVisualvm do ?

Thanks in advance


Yannick
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: ClassNotFoundException when attaching to local process

Post by Anton Katilin »

Hi Yannick

When attaching, please specify the startup option "disableall" to avoid bytecode instrumentation.
Does it help?

Best regards,
Anton
yannick
Posts: 3
Joined: Tue Apr 21, 2015 4:08 pm

Re: ClassNotFoundException when attaching to local process

Post by yannick »

Thank you for this answer ! I'll try that.
Also maybe you'll be interested to know I didn't get any notification that you answered !
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: ClassNotFoundException when attaching to local process

Post by Anton Katilin »

Hi Yannick

Did it help?
Also maybe you'll be interested to know I didn't get any notification that you answered !
Do you mean the email notification? Perhaps it was a spam filtering issue.

Best regards,
Anton
yannick
Posts: 3
Joined: Tue Apr 21, 2015 4:08 pm

Re: ClassNotFoundException when attaching to local process

Post by yannick »

When attaching, please specify the startup option "disableall" to avoid bytecode instrumentation.
It does work ! Thanks !
Now I'm doing it by right-clicking the process / Attach with custom startup options / typing "disableall" in the text field. Is there a way to set it as a default ?

Also, I know JBoss does nothing like the others :) but trying to attach without the disableall option breaks the server :(
So it would be good if you good detect beforehand that yourkit classes are not available and default to no instrumentation mode if it is possible.
Do you mean the email notification? Perhaps it was a spam filtering issue.
Yes that is what I meant ! And no I couldn't find your mail in the spam folder.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: ClassNotFoundException when attaching to local process

Post by Anton Katilin »

Is there a way to set it as a default ?
No.

Instead, I suggest to set the environment variable YJP_STARTUP_OPTIONS_PRE to disableall, e.g. for the user under which you run the profiled application. Profiled processes will prepend their normally supplied startup options (empty by default, if you attach by double-clicking) with its value.
So it would be good if you good detect beforehand that yourkit classes are not available and default to no instrumentation mode if it is possible.
Unfortunately, this is technically impossible: instrumentation is performed (or not performed) on a lower level than class loading, and earlier than when it is possible to detect whether the agent classes can be loaded or not.
Post Reply