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
ClassNotFoundException when attaching to local process
-
- Posts: 3
- Joined: Tue Apr 21, 2015 4:08 pm
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: ClassNotFoundException when attaching to local process
Hi Yannick
When attaching, please specify the startup option "disableall" to avoid bytecode instrumentation.
Does it help?
Best regards,
Anton
When attaching, please specify the startup option "disableall" to avoid bytecode instrumentation.
Does it help?
Best regards,
Anton
-
- Posts: 3
- Joined: Tue Apr 21, 2015 4:08 pm
Re: ClassNotFoundException when attaching to local process
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 !
Also maybe you'll be interested to know I didn't get any notification that you answered !
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: ClassNotFoundException when attaching to local process
Hi Yannick
Did it help?
Best regards,
Anton
Did it help?
Do you mean the email notification? Perhaps it was a spam filtering issue.Also maybe you'll be interested to know I didn't get any notification that you answered !
Best regards,
Anton
-
- Posts: 3
- Joined: Tue Apr 21, 2015 4:08 pm
Re: ClassNotFoundException when attaching to local process
It does work ! Thanks !When attaching, please specify the startup option "disableall" to avoid bytecode instrumentation.
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.
Yes that is what I meant ! And no I couldn't find your mail in the spam folder.Do you mean the email notification? Perhaps it was a spam filtering issue.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: ClassNotFoundException when attaching to local process
No.Is there a way to set it as a default ?
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.
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.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.