I've been able to get loadtime weaving going, but not hotswap weaving. I was wondering if anyone might be able to help me get over this hurdle.
To prepare the environment for HotSwap, I've tried going the following
- In $JBOSS_HOME/server/all/conf/bootstrap/aop.xml, set enableLoadtimeWeaving to true.
- Placed a copy of the pluggable-instrumentor.jar that comes with JBoss AS 6 into $JBOSS_HOME/bin
- Passed in -javaagent:pluggable-instrumentor.jar=-hotSwap as a argument to Java. This was attemped both by passing it in via an Eclipse JVM parameter, and by editing run.conf.bat.
- Placed my application's EAR file containing the class to be instrumented into the $JBOSS_HOME/server/all/deploy directory.
- Placed a file called prepare-aop.xml within $JBOSS_HOME/server/all/deploy, for the purposes of preparing a class for HotSwap AOP. It just contains the following:
<aop xmlns="urn:jboss:aop-beans:1.0">
<prepare expr="all(mypackage.MyClass)" />
</aop>
Now, when I start the server, my application gets loaded, I can the URL for MyClass, just fine. However, my hope is that when I place a file called myaspects-aop.xml into $JBOSS_HOME/server/all/deploy, then MyClass would automatically get instrumented with the aspect below, which just logs that it has been invoked. However, that is not happening.
<aop xmlns="urn:jboss:aop-beans:1.0">
<aspect class="mypackage.MyAspect" scope="PER_JOINPOINT">
</aspect>
<bind pointcut="execution( * mypackage.MyClass->*(..) )">
<advice aspect="mypackage.MyAspect" />
</bind>
</aop>
Any insight would be most appreciated!