From f37fb474d64d388af0501e0a0556db9651c5ee5c Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 27 Sep 2008 17:26:50 +0000 Subject: [PATCH] some ltw notes --- docs/faq/faq.xml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/faq/faq.xml b/docs/faq/faq.xml index 05ddbc903..7f5664dfc 100644 --- a/docs/faq/faq.xml +++ b/docs/faq/faq.xml @@ -4274,6 +4274,33 @@ java -javaagent:aspectjweaver.jar -classpath "aspects.jar:${CLASSPATH}" .. + + + How do I get load-time weaving to work in my chosen application server? + + + + You have two choices based on how wide you want the weaving to take effect: application-server wide and application-specific weaving. + You choose between the two by loading aspect artifacts--aspects, associated types, and aop.xml--through the right classloader. + The aop.xml must be in the META-INF directory on the classpath for the chosen classloader. In either case, you modify the + startup script to specify the -javaagent:path-to/aspectjweaver.jar option to the Java virtual machine. Note that it is not + essential that all the artifacts be placed in a single jar. + + For application-server wide weaving, you make aspect artifacts accessible to the server's classloader. Typically, you + achieve such access by putting these artifacts in the server's lib directory. For example, for Tomcat, you will place + the aspect artifacts in the TOMCAT_HOME/lib directory. + For application-specific weaving, you make aspect artifacts accessible to application classloader by bundling + them along with application's classes. For example, for a web application, you will place the aspect artifacts in + the MY_APP/WEB-INF/lib and/or MY_APP/WEB-INF/classes directory. + + We recommend that you start with application-specific weaving. + Note that you have an additional option if your application is based on the Spring framework. If you deploy in one of + the supported web servers or application servers, you can avoid modifications to the startup script. Please + see http://static.springframework.org/spring/docs/2.5.x/reference/aop.html#aop-aj-ltw-spring for more details. + + + -- 2.39.5