4 Replies Latest reply on Sep 15, 2005 9:45 AM by kabirkhan

    Precompiled instrumentation in JBoss 4 and Java 5

    chlabreu

      I was using loadtime transformantion in JBoss 4 with Java 5 and now I'm trying without success to setup the same system to use compile time transformations. The problem is I'm getting annotations to not work as if they were not present in code. Is there any aditional step in compilation of aspects or anything else I'm probably missing? I'm not using any custom annotation, only the ones provided by aspects library. Thanks.

        • 1. Re: Precompiled instrumentation in JBoss 4 and Java 5
          kabirkhan

          Does this apply to all the annotations you are using or just some? IIRC I noticed one or two which did not have the proper RetentionPolicy set since the last release, meaning they are not present in the compiled code.

          Which version of JBoss AS/JBoss AOP are you using

          Also, note that even if you do compile-time weaving you still need to deploy a jboss-aop.xml file (optionally in a .aop file)

          • 2. Re: Precompiled instrumentation in JBoss 4 and Java 5
            chlabreu

            I'm using JBoss 4.0.2 and JBoss AOP 1.3. The annotation that is not working is the @Tx annotation. Other aspects applied in jboss-aop.xml seems to be working well.

            • 3. Re: Precompiled instrumentation in JBoss 4 and Java 5
              kabirkhan

              Yes,

              the TX annotation is the one

              /*
               * JBoss, the OpenSource EJB server
               *
               * Distributable under LGPL license.
               * See terms of license at gnu.org.
               */
              package org.jboss.aspects.tx;
              
              import java.lang.annotation.Retention;
              import java.lang.annotation.RetentionPolicy;
              
              /**
               *
               * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
               * @version $Revision: 1.2 $
               */
              @Retention(RetentionPolicy.RUNTIME) //This is the fix
              public @interface Tx
              {
               TxType value() default TxType.REQUIRED;
              }
              


              Compile this and replace in jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar

              Note that you will need to recompile all your classes using the annotation

              • 4. Re: Precompiled instrumentation in JBoss 4 and Java 5
                kabirkhan

                of course you can get this from our cvs too