I would like to profile my webapp with JVisualVM on JBoss 7.
So I launch that tool, and open the JVM running JBoss.
I click on "Profiler", "Settings" and in "CPU settings" I put that :
"Start profiling from classes:" : com.mycompany.myapp.action.**
Profile new Runnables
"Profile only classes:" : com.mycompany.*
And when I click on "CPU" (to profile CPU), in JBoss I've got :
Profiler Agent: 250 classes cached.
Profiler Agent: Redefining 100 classes at idx 0, out of total 188
Profiler Agent: Redefining 88 classes at idx 100, out of total 188
10:26:05,720 ERROR [stderr] (server-timer1) Exception in thread "server-timer1" java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeCPUFullInstr
10:26:05,721 ERROR [stderr] (server-timer1) at org.jboss.sun.net.httpserver.ServerImpl$ServerTimerTask1.run(ServerImpl.java:895)
10:26:05,722 ERROR [stderr] (server-timer1) at java.util.TimerThread.mainLoop(Timer.java:534)
10:26:05,722 ERROR [stderr] (server-timer1) at java.util.TimerThread.run(Timer.java:484)
By googling, it seems I must add jfluid-server.jar
in the JBoss classpath but when I do that with Eclipse, the jar disappears before I re-launch the server...
Others advice to launch VisualVM with a classpath containing JBoss modules' jar, but I still have the errors in the JBoss AS.
Is there a configuration in standalone.xml
in order to add that jar to JBoss 7 classpath ?
Thanks !
Adding -Djboss.modules.system.pkgs=org.netbeans.lib.profiler.server
to the JVM arguments seems to avoid that exception. Seen on https://issues.jboss.org/browse/JBAS-8927.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With