Version 4

    Enabling loadtime weaving in JBoss AS

     

    Complete the following steps:

    • Download the latest JBoss AOP

    • Unzip and from the created directory, copy lib50/pluggable-instrumentor.jar to your bin directory.

    • If you are starting JBoss via the run.sh: In run.conf, add the following line: JAVA_OPTS="$JAVA_OPTS -javaagent:pluggable-instrumentor.jar"

    • If you are starting JBoss via the run.bat: In run.bat, add the following two lines at the start of your

      set JBOSS_CLASSPATH=%DIRNAME%pluggable-instrumentor.jar
      set JAVA_OPTS=-javaagent:pluggable-instrumentor.jar
    
    • Modify server/all/deploy/jboss-aop-jdk50.deployer/META-INF/jboss-service.xml so it contains:

     

       <mbean code="org.jboss.aop.deployment.AspectManagerServiceJDK5"
          name="jboss.aop:service=AspectManager">
          <attribute name="EnableLoadtimeWeaving">true</attribute>
          <!-- only relevant when EnableLoadtimeWeaving is true.
               When transformer is on, every loaded class gets
               transformed.  If AOP can't find the class, then it
               throws an exception.  Sometimes, classes may not have
               all the classes they reference.  So, the Suppressing
               is needed.  (i.e. Jboss cache in the default configuration -->
          <attribute name="SuppressTransformationErrors">true</attribute>
          <attribute name="Prune">true</attribute>
          <attribute name="Include">org.jboss.test, org.jboss.injbossaop, org.jboss.shotoku, org.jboss.forge, org.jboss.wiki</attribute>
          <attribute name="Exclude">org.jboss., org.apache., org.tmatesoft</attribute>
          <attribute name="Optimized">true</attribute>
          <attribute name="Verbose">false</attribute>
       </mbean>
    

     

    • Run the server with the "all" configuration.