myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Myfaces Wiki] Update of "TracingMyFacesUsingAspectJ" by JamesRichards
Date Tue, 06 Jun 2006 20:19:26 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by JamesRichards:

      private static void printEntering(String str) {
          String idt = getIndent();
- //        log.error(idt + ">>>" + str);
          try {
              fWrt.write(idt + ">>>" + str + "\n");
@@ -154, +153 @@

+ The development environment for following this example is as follows:
+ Eclipse 3.1.x from
+ AJDT 1.3.1 from
+ This page will not discuss the basic usage of the AspectJ Eclipse plugin but the AJDT site
provides excellent tutorials:
+ Before using the above trace, please understand the basic workings of the AJDT so that you
can convert your standard MyFaces Java project to use AspectJ.
+ Once you have Eclipse and the AJDT available, you will want to convert your standard Java
project to an AspectJ project.  Right click on the MyFaces project which you wish to debug
and choose "Convert to AspectJ Project".  Be aware that the AspectJ compiler may take a little
longer to compile than the standard compiler, especially if you are aspecting a lot of project
+ Once the AspectJ nature is added, you will want to add the myfaces libraries to the AspectJ
weaving path:
+ 1) Right click on your MyFaces project
+ 2) Choose "Properties" from the context menu
+ 3) In the properties dialog, select the "AspectJ InPath" screen
+ 4) On this screen choose the "Libraries and Folders" tab and add each of the MyFaces jars.
 For MyFaces 1.1.1, you should have three jars [possibly with different names]:
+ myfaces-api-1.1.1.jar, myfaces-impl-1.1.1.jar and tomahawk-myfaces-1.1.1.jar 
+ 5) Add the above trace source code to your project
+ 6) The AspectJ compiler will now compile your source and will weave the trace into the MyFaces
+ 7) Copy the ouput of the compilation to your web applications "WEB-INF/classes" directory
and restart your server
+ 7a) NOTE: if you are not using a web application, you must merely ensure that the woven
classes are first in the runtime classpath of your application
+ Upon relaunching your application, once MyFaces actually runs, you should be able to "tail
-f c:\trace.out" to follow the execution of MyFaces.  Note that the file location should be
changed as appropriate for Unix.

View raw message