Search

8.7. JRockit

download PDF
JRockit also supports the -javaagent switch mentioned in Section 8.6, “Loadtime transformation in the JBoss Enterprise Application Platform Using Sun JDK”. If you wish to use that, then the steps in Section 8.6, “Loadtime transformation in the JBoss Enterprise Application Platform 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 want to do load-time transformations using the special JRockit hooks, these are the steps you must take.
  • Set the enableLoadtimeWeaving attribute/property to true. By default, JBoss Enterprise Application Platform 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 include all the classes referenced.
  • Copy the jrockit-pluggable-instrumentor.jar from the lib/ directory of your JBoss AOP distribution to the bin/ directory of your the JBoss Enterprise Application Platform installation.
  • Next edit 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 specific properties
    
    JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME \
    
    -Xmanagement:class=org.jboss.aop.hook.JRockitPluggableClassPreProcessor"
    
    JBOSS_CLASSPATH="$JBOSS_CLASSPATH:jrockit-pluggable-instrumentor.jar"
    
  • Set the class of the AspectManager Service to org.jboss.aop.deployers.AspectManagerJRockit on JBoss Enterprise Application Platform 5, or org.jboss.aop.deployment.AspectManagerService as these are what work with special hooks in JRockit.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.