3 Replies Latest reply on Apr 5, 2012 1:57 PM by Carsten Luxig

    Integration with YourKit Java Profiler

    Marek Smigielski Newbie

      Hi,

       

      I try to enable YourKit Java Profiler for jbossas7 and whatever I do I get ClassNotFound exception:

       

      Caused by: java.lang.ClassNotFoundException: com.yourkit.runtime.Callback from [Module "org.jboss.stdio:main" from local module loader @24f9fdc (roots: /Users/marek/Tools/jboss-as-web-7.0.1.Final/modules)]
                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
                ... 8 more
      
      

       

      I have created com.yourkit module and add it as dependency to few other modules like: org/jboss/as/server, org/apache/log4j, org/jboss/logmanager, ...

       

      As I do it I move one step forward, but still the same question arise:

       

      Is there any way of providing single jar for all application server, all modules and all deployments. It will be good to know even if I have to hack some jars.

       

      regards

        • 1. Re: Integration with YourKit Java Profiler
          Carlo de Wolf Master

          Look through bin/standalone.conf you'll find how to setup jboss.modules.system.pkgs for use with a profiler.

           

          Looking forward to your contribution for adding YourKit Java Profiler. ;-)

          • 2. Re: Integration with YourKit Java Profiler
            Marek Smigielski Newbie

            If you find yourself in need of profiling jbossas7 with yourkit you should do:

            1. Create the module in modules directory of your jbossas7 home:

             

            1a. create directory: modules/com/yourkit/profiler/main

            1b. create file module.xml file in this directory as follows

            <?xml version="1.0" encoding="UTF-8"?>
            <module xmlns="urn:jboss:module:1.0" name="com.yourkit.profiler">
                <resources>
                    <resource-root path="yjp.jar"/>
                    <!-- Insert resources here -->
                </resources>
            
            
            </module>
            

             

            1c. copy yjp.jar from yourkit lib directory to main directory.

             

            2. add JAVA_OPTS to standalone.conf or whatever configuration file are you using:

             

            JAVA_OPTS="$JAVA_OPTS -agentpath:<path_to_yourkit>/bin/mac/libyjpagent.jnilib -Djboss.modules.system.pkgs=com.yourkit.profiler"
            

             

            of course you need to change native library according to your system environment.

             

            3. start your yourkit and connect to your application.

            • 3. Re: Integration with YourKit Java Profiler
              Carsten Luxig Newbie

              There might be an error, use -Djboss.modules.system.pkgs=com.yourkit instead of -Djboss.modules.system.pkgs=com.yourkit.profiler