1 Reply Latest reply on Apr 1, 2009 11:12 AM by flavia.rainone

    Custom ClassFileTransformer disables JBoss AOP

    fbrueseke

      Hi JBoss AOP experts.

      I have been using a ClassFileTransformer in my program to build a registry of certain classes. It is loaded through the pluggable instrumentor. This solution is described in the following thread: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4185334#4185334.

      Now I wanted to use JBoss AOP in the same application. After widdling around with the two things like forever I have found out: My ClassFileTransformer disables AOP completely. It seem that it reverts the transformation the AOP transformer does.

      To be precise I must state that I use JBoss 4.2 which includes JBoss 1.5.6 and Java 5.

      My question is: Is there a way to use my ClassFileTransformer and JBoss AOP at the same time?

      Kind regards
      Frank

        • 1. Re: Custom ClassFileTransformer disables JBoss AOP
          flavia.rainone

          Frank,

          I don't see how your transformer would disable JBoss AOP. The javadoc of java.lang.instrument.Instrumentation states that every registered transformer will be called.

          Specially, if you are not transforming the class... for what I understood, you are using the ClassFileTransformer only to register the class, and not to transform it, right?

          This seems to be a bug in the JVM. I would try a few things:
          - try to return the same bytecodes that you got as a parameter instead of null
          - try to run this using a different jvm
          - check to see if the bytecodes your ClassFileTransfomer is receiving are weaved or not, and also check the stack trace when it executes, to see if the classFileTransfomer is on the stack

          Let me know if any of this gives us a clue on what is wrong.