This topic has not yet been written. The content below is from the topic description.
Now for the interesting bit - how is it all packaged? Before running the examples, open the local.properties file and set jboss.dir to point to your JBoss distribution. WAR examples We'll start off looking at a few ways you can package a war file. Standard WAR with stand-alone jboss-aop.xml file Note Due to changes in the default web classloader settings from JBoss 4.0.2 onwards, which effectively mean that jars in WEB-INF/lib directory and classes in the WEB-INF/classes directory do not get transformed, for this example to work you must set the UseJBossClassLoader attribute to true in the jboss.web:service=WebServer service. You can either do this by Modifying the setting in JBOSS_HOME/server/all/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml}} before starting JBoss Modifying the setting using the JMX Console An alternative is to package your application as shown further below in the "WAR and .aop lib file contained in a JAR" example. The above only applies to this current example If you run $ant deploy-basic-lt-war two files get deployed: jboss-aop.xml and aopexample.war aopexample.war is a bog-standard war file. It contains index.jsp WEB-INF/web.xml WEB-INF/lib/aopexamplelib.jar aopexamplelib.jar contains: org/jboss/injbossaop/lib/ExampleValue.class org/jboss/injbossaop/lib/SimpleInterceptor.class org/jboss/injbossaop/mbean/Standard.class (Never called in this example) org/jboss/injbossaop/mbean/StandardMBean.class (Never called in this example) org/jboss/injbossaop/web/BasicExampleServlet.class org/jboss/injbossaop/web/EarExampleServlet.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSession.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSessionBean.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSessionHome.class (Never called in this example) The magic comes from deploying the jboss-aop.xml file BEFORE the war is deployed WAR and .aop lib file contained in a SAR If you run $ ant deploy-basic-lt-war-in-sar Only one file gets deployed: aopexample.sar. aopexample.sar contains: aopexample.war aopexamplelib.aop META-INF/jboss-service.xml aopexample.war contains index.jsp WEB-INF/web.xml aopexamplelib.aop contains more or less the same as aopexamplelib, but contains a META-INF/jboss.aop file: org/jboss/injbossaop/lib/ExampleValue.class org/jboss/injbossaop/lib/SimpleInterceptor.class org/jboss/injbossaop/mbean/Standard.class org/jboss/injbossaop/mbean/StandardMBean.class org/jboss/injbossaop/web/BasicExampleServlet.class org/jboss/injbossaop/web/EarExampleServlet.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSession.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSessionBean.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSessionHome.class (Never called in this example) META-INF/jboss-aop.xml WAR and .aop lib file contained in a JAR If you run $ ant deploy-basic-lt-war-in-jar Only one file gets deployed: aopexample.jar. aopexample.jar contains: aopexample.war aopexamplelib.aop aopexample.war contains index.jsp WEB-INF/web.xml aopexamplelib.aop contains more or less the same as aopexamplelib, but contains a META-INF/jboss.aop file: org/jboss/injbossaop/lib/ExampleValue.class org/jboss/injbossaop/lib/SimpleInterceptor.class org/jboss/injbossaop/mbean/Standard.class (Never called in this example) org/jboss/injbossaop/mbean/StandardMBean.class (Never called in this example) org/jboss/injbossaop/web/BasicExampleServlet.class org/jboss/injbossaop/web/EarExampleServlet.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSession.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSessionBean.class (Never called in this example) org/jboss/injbossaop/ejb/ExampleSessionHome.class (Never called in this example) META-INF/jboss-aop.xml