JBoss.org Community Documentation
JRockit also supports the -javaagent switch mentioned in Section 10.3.3, “Loadtime transformation in JBoss AS Using Sun JDK”. If you wish to use that, then the steps in Section 10.3.3, “Loadtime transformation in JBoss AS Using Sun JDK” are sufficient. However, JRockit also comes with its own framework for intercepting when classes are loaded, which might be faster than the -javaagent switch. If you wish to use this, there are three steps you must take.
If you want to do load-time transformations with JBoss 5 and JRockit using the special JRockit hooks, these are the steps you must take.
enableLoadtimeWeaving
attribute/property to true.
By default, JBoss application server will not do load-time bytecode manipulation
of AOP files unless this is set. If suppressTransformationErrors
is true
failed bytecode transformation will only give an error warning. This flag is
needed because sometimes a JBoss deployment will not have all the classes a class references.
jrockit-pluggable-instrumentor.jar
from the lib/
directory of your JBoss AOP distribution to the bin/
directory of your
JBoss AOP application server installation.
run.sh
or
run.bat
(depending on what OS you're on) and add the following to the JAVA_OPTS
and JBOSS_CLASSPATH environment variables:
# Setup JBoss sepecific properties JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME \ -Xmanagement:class=org.jboss.aop.hook.JRockitPluggableClassPreProcessor" JBOSS_CLASSPATH="$JBOSS_CLASSPATH:jrockit-pluggable-instrumentor.jar"
org.jboss.aop.deployers.AspectManagerJRockit
on JBoss 5, or org.jboss.aop.deployment.AspectManagerService
as these are what work with
special hooks in JRockit.