3 Replies Latest reply on Mar 30, 2005 9:05 AM by JB B

    IS AOP with Session stateless working on 4.0 AS ?

    JB B Newbie

      Hi all,

      I am testing a custom aspect on the method of session bean.

      For that purpose I have setup two files :
      - one that is the .aop and is holding the Interceptor and its configuration
      - the other, an .ear that is holding my application (a .jar and a .war)

      Deploying this, I am able to see that my method has been recognized and the class transformed, right. I can see in the tmp folder the class generated and was able to JAD it. But as soon as I call the method, nothing happen. I am also not able to find the transformed version of my bean in the tmp.

      I am using the dynamic generation of the AOP as I can not find a way to exacute the aopc in the JBoss IDE on an existing J2EE project :(

      I am locked since more than a week so I would be glad to hear from anybody that have succesfully done such a "simple" thing.

      Rgs,
      JB

        • 1. Re: IS AOP with Session stateless working on 4.0 AS ?
          Bill Burke Master

          you have to add a jboss-app.xml to your EAR's META-INF directory (it is the jboss specific application.xml DD).

          
          <jboss-app>
           <module>
           <service>foo.aop</service>
           </module>
          </jboss-aop>
          
          



          • 2. Re: IS AOP with Session stateless working on 4.0 AS ?
            Bill Burke Master

            Also, did you try out the tutorial?

            examples/injboss?

            So yes...We have done such a simple thing.

            What version of JBoss? Did you set up the load-time transformer correctly? Or are you using AOPC? How did you set up the load-time transformer?

            I can't really help with with JBoss IDE as I don't maintain it. Rob Stryker may be able to help you out: rawblem@gmail.com

            • 3. Here is my setup ...
              JB B Newbie

               

              "bill.burke@jboss.com" wrote:
              Also, did you try out the tutorial?

              examples/injboss?

              So yes...We have done such a simple thing.

              What version of JBoss? Did you set up the load-time transformer correctly? Or are you using AOPC? How did you set up the load-time transformer?

              I can't really help with with JBoss IDE as I don't maintain it. Rob Stryker may be able to help you out: rawblem@gmail.com


              My test is the usual fibonacci EJB session stateless example.

              I am using JBoss 4.0.1sp1 with J2SE 1.5.0-b64. I have setup the load-time transformer as explained in the doc by enabling the attribute EnableTransformer in all/deploy/jboss-aop.deployer/META-INF/jboss-service.xml to true.

              FYI, I am not able to use AOPC (as I am not able to find a way to add it as a builder in the Eclipse !), I will contact Rob for that specific issue.

              Let's get back to topic.

              Deploying the files .aop, using the JMX console, I am able to verify that my aspect is loaded. then deploying the .ear and checking the verbose log of aop the class get matched and transformed as expected :

              "
              ...
              20:24:22,117 INFO [STDOUT] [trying to transform] tutorial.ejb.FiboBean
              ....
              20:24:22,167 INFO [STDOUT] [debug] does compute match execution(public double[] tutorial.ejb.FiboBean->compute(int)): true
              20:24:22,918 INFO [STDOUT] [debug] was tutorial.ejb.FiboBean converted: true20:24:22,998 INFO [STDOUT] [cannot compile] isInterface: tutorial.interfaces.FiboHome
              20:24:23,008 INFO [STDOUT] [cannot compile] isInterface: tutorial.interfaces.Fibo
              20:24:23,028 INFO [EjbModule] Deploying Fibo
              ...
              "

              Also I can see a file is created in all\tmp\aopdynclasses\ucl7274\tutorial\ejb it is FiboBean_compute_4700615691092053624_OptimizedMethodInvocation.class

              This is IMHO indicating that aop is ok ? is it ?

              Well perfect, but if so where is the transformation of the FiboBean class ?
              Because going in all\tmp\deploy\tmp7273FiboApp.ear-contents\FiboEJB.jar and jadding the FiboBean, it is an untouched file (ie, not instrumentized by JBossAOP in any way)!

              Note : Verbose mode on AOP is nice, but an idea could be to have the log only for a particular aspect and not the whole pile. Such a feature could ease the aspect tracking (thu a JMX property).

              Regards,
              JB