Friday, February 16, 2007

Configure JBoss AOP 1.5.3 FOR JBoss 4.0.4 GA
  1. Download the JBoss AOP package
  2. Copy all the files in the directory "{JBoss-AOP-1.5.3}/lib-50" into "{Jboss}/server/default/lib"
  3. Remove the old "jboss-aop-deplopyer" from the "{Jboss}/server/default/deploy" if any
  4. Copy the whole directory from "{JBoss-AOP-1.5.3}/jboss-40-install/jboss-aop-jdk50.deployer" to the directory "{Jboss}/server/default/deploy"
  5. Remove the files "javassist.jar" and "common-softwarevaluehashmap.jar" from the "{Jboss}/server/default/deploy/jboss-aop-jdk50.deployer" directory.
  6. Edit the "{Jboss}/server/default/deploy/jboss-aop-jdk50.deployer/META-INF/jboss-service.xml" file, set the "EnableLoadtimeWeaving" to true, in the "Exclude" attribute, add ",org.apache.,org.quartz.,java."

    The following shows the file content
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- $Id: jboss-service.xml 44143 2006-04-24 18:19:21Z kkhan $ -->
    <!--
    =====================================================================
    -->
    <!-- JBoss Server
    Configuration
    -->
    <!--
    =====================================================================
    -->
    <server>
    <!-- The code for the service is different for the
    different run scenarios
    *** JBoss 4.0
    * JDK 1.4 -
    org.jboss.aop.deployment.AspectManagerService
    * JDK 5 (not
    using -javaagent switch) - org.jboss.aop.deployment.AspectManagerService
    * JDK 5 (using
    -javaagent switch) - org.jboss.aop.deployment.AspectManagerServiceJDK5
    * BEA JRockit
    1.4.2 - org.jboss.aop.deployment.AspectManagerService
    *** JBoss 3.2
    * JDK 1.4 -
    org.jboss.aop.deployment.AspectManagerService32
    * JDK 5 (not
    using -javaagent switch) -
    org.jboss.aop.deployment.AspectManagerService32
    * JDK 5 (using
    -javaagent switch) - org.jboss.aop.deployment.AspectManagerService32JDK5
    * BEA JRockit
    1.4.2 - org.jboss.aop.deployment.AspectManagerService32
    -->
    <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</attribute>
    <attribute
    name="Exclude">org.jboss.,org.apache.,org.quartz.,java.</attribute>
    <!-- This avoids instrumentation of
    hibernate cglib enhanced proxies-->
    <attribute
    name="Ignore">*$$EnhancerByCGLIB$$*</attribute>
    <attribute
    name="Optimized">true</attribute><attribute
    name="Verbose">false</attribute>
    </mbean>
    <mbean code="org.jboss.aop.deployment.AspectDeployer"
    name="jboss.aop:service=AspectDeployer">
    </mbean>
    </server>

  7. Edit the file "{Jboss}/server/bin/run.sh" , change the line JAVA_OPTS to the following
    JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME -javaagent:/usr/local/share/app/jboss-4.0.4.GA-test/server/default/lib/pluggable-instrumentor.jar"


0 comments: