0 Replies Latest reply on Oct 15, 2005 12:18 PM by Archit Pandey

    aopc task not able to instrument my classes. [no comp needed

    Archit Pandey Newbie

      hi,

      I am new to jboss AOP. I am trying to instrument my classes at compile time using ant's "aopc" task.
      When I run, the "aopc" task gives me a "[no comp needed]" message with the name of the class.
      I checked up the class by decompiling the class using "javap", but that showed no injected code in the class.
      Interestingly, the aopc does not show me a "[trying to transform]" message as it does when i run examples of jboss AOP.

      The jboss-aop.xml file I used is

      <?xml version="1.0" encoding="UTF-8"?>
      <aop>
      
       <bind pointcut="execution(public * *->*(..))">
       <interceptor class="org.jboss.aspects.PerformanceInterceptor"/>
       </bind>
      </aop>
      


      I mentioned the task as
      <aopc compilerclasspath="${cart.and.aop.classpath}" verbose="true">
       <classpath path="${cart.classbindir}"/>
       <src path="${cart.classbindir}"/>
       <include name="**/*.class"/>
       <aoppath path="${jboss-aop.xml}"/>
       <aopclasspath path="${jboss-interceptor-jar}"/>
       </aopc>


      The execution showed me
      [aopc] [debug] Passed in instrumentor: null
       [aopc] [debug] Defaulting instrumentor to: org.jboss.aop.instrument.ClassicInstrumentor
       [aopc] [debug] jboss.aop.class.path: D:\jboss-aop_1.3.4\lib\PerformanceInterceptor.jar
       [aopc] [debug] Looking for aspects in: org.jboss.aspects.PerformanceInterceptor
       [aopc] [debug] Looking for aspects in: org.jboss.aspects.SimpleInterceptor
       [aopc] [debug] jboss.aop.search.classpath: 'null' true
       [aopc] [debug] jboss.aop.path: D:\jboss-4.0.2\server\default\deploy\jboss-aop-jdk50.deployer\jboss-aop.xml
       [aopc] jboss.aop.path[0]: D:\jboss-4.0.2\server\default\deploy\jboss-aop-jdk50.deployer\jboss-aop.xml
       [aopc] [deploying] file:/D:/jboss-4.0.2/server/default/deploy/jboss-aop-jdk50.deployer/jboss-aop.xml
       [aopc] [no comp needed] C:\regressionTesting\petstore1.3.2\src\components\cart\build\classes\com\sun\j2ee\blueprints\cart\model\CartItem.class
       [aopc] [no comp needed] C:\regressionTesting\petstore1.3.2\src\components\cart\build\classes\com\sun\j2ee\blueprints\cart\ejb\ShoppingCartLocalHome.class
       [aopc] [no comp needed] C:\regressionTesting\petstore1.3.2\src\components\cart\build\classes\com\sun\j2ee\blueprints\cart\model\ShoppingCartModel.class
       [aopc] [no comp needed] C:\regressionTesting\petstore1.3.2\src\components\cart\build\classes\com\sun\j2ee\blueprints\cart\ejb\ShoppingCartLocalEJB.class
       [aopc] [no comp needed] C:\regressionTesting\petstore1.3.2\src\components\cart\build\classes\com\sun\j2ee\blueprints\cart\ejb\ShoppingCartLocal.class
       [aopc] Build Successful: 375 ms


      After using javap on the class "CartItem" I got the following output
      public java.lang.String getCategory();
       Code:
       0: aload_0
       1: getfield #2; //Field category:Ljava/lang/String;
       4: areturn
      
      public java.lang.String getItemId();
       Code:
       0: aload_0
       1: getfield #3; //Field itemId:Ljava/lang/String;
       4: areturn
      
      public java.lang.String getProductId();
       Code:
       0: aload_0
       1: getfield #4; //Field productId:Ljava/lang/String;
       4: areturn
      


      This is snippet of the decompiled CartItem class, but it does not show any instrumentation.

      Can somebody help me with this??

      Regards,
      Archit