I could not make the loadtime weaving work but using the AOPC compiler I could make it work to run AOP within JBoss AS and EJB3 RC3.
Read all of chapter 10, but most importantly: http://docs.jboss.com/aop/1.3/aspect-framework/reference/en/html/running.html#d0e2812
In the AOP distribution there is a tutorial example called "injboss" to explain how to package stuff and to help you verify that you have everything set up correctly
Ok, finally I could it work, somewhat.
These were the steps:
- adjust the jboss-aop-jdk50.deployer/META-INF/jboss-service.xml
- set the MBean class to: 'org.jboss.aop.deployment.AspectManagerServiceJDK5'
- set the 'EnableLoadtimeWeaving' to 'true'
- copy the 'pluggable-instrumentor.jar' into the 'bin' directory
- adjust the run.conf file so that JAVA_OPTS is extended this way:
- deploy the AOP file or the JAR archive and the *-aop.xml file
- fire up JBoss and voila it does instrument it
Now I just run into the snag that instrumenting code of the size of ~300KB does make JBoss run out of memory even though I set the minimum heap size to 512m and the maximum to 1024m. But I also disovered a similar problem with AOPC and had to run the instrumentation in multiple steps.