1 Reply Latest reply on Feb 19, 2013 11:26 AM by karthikeyan bg

    Stuck trying to get HotSwap weaving going with JBoss AS 6

    Mark DeSpain Newbie

      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

      1. In $JBOSS_HOME/server/all/conf/bootstrap/aop.xml, set enableLoadtimeWeaving to true.
      2. Placed a copy of the pluggable-instrumentor.jar that comes with JBoss AS 6 into $JBOSS_HOME/bin
      3. 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.
      4. Placed my application's EAR file containing the class to be instrumented into the $JBOSS_HOME/server/all/deploy directory.
      5. 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)" />




      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">


                <bind pointcut="execution( * mypackage.MyClass->*(..) )">

                                    <advice aspect="mypackage.MyAspect" />




      Any insight would be most appreciated!