Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling a webapp on JBoss 7 with JVisualVM

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 !

like image 902
Anthony O. Avatar asked Jan 31 '13 09:01

Anthony O.


1 Answers

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.

like image 121
Anthony O. Avatar answered Dec 11 '22 10:12

Anthony O.