This example describe how to profile a example application in JBoss Application Server using FastAOP

FastAOP together with Perfmon is able to collect performance data with nearly no overhead. It can even profile applications running in production. This 10 minutes How-To present a slow Hotel Booking Example. This are the steps to run it on your machine:

Setup JBoss Application Server to run with FastAOP:

Add this line of code to your run.bat/

 rem Enable FastAOP with JBoss
 set JAVA_OPTS=%JAVA_OPTS% -Xbootclasspath/a:%JBOSS_HOME%\lib\fastaop-1.0.jar 
     -Dfastaop-path=%JBOSS_HOME%\fast-aop-aspects -javaagent:%JBOSS_HOME%\lib\fastaop-1.0.jar

Deploy the example application and aspects

Define Workflows you are interested in - you want to monitor

Create in $JBossInstallDir$/fast-aop-aspects directory a file named and add the following content into it:



This file defines in which workflows you are interested in. A workflow in this case is simply a number of consecutive method calls starting with a defined entry method. Such workflow specification starts the report generation for all executions of methods occurring until the entry method is finished. Once this method is finished the report will be written to the file system.

Start the server and click through the Example application

Start the server and open http://localhost:8080/seam-booking/ . Now register a user, login as this user and search a hotel. Now you will find in $JBossInstallDir$/fast-aop-aspects/reports generated reports telling you exactly which methods are slow. If you want to see the source code of the hotel booking application you can download the and open it in Eclipse. You will see that the report points you to the right places - slow layers in your app.


We introduced slow code into the hotel booking example (JBoss Seam is in reality fast!). You see by opening the reports exactly which methods in which layers are slow. If a layer is making calls to other layers, the time spent in these layers is automatically subtracted from the time for the caller. This behavior is very important to detect the performance.

To see how the how the layer mapping is defined you should checkout the example project from our Subversion repository. You will see that only 4 classes are required to profile a Ejb3/ JBoss-Seam based architecture.