3 Replies Latest reply on Jan 23, 2006 8:15 PM by schaefera

    AOP Inside JBoss 4.0.3 with EJB3 does not work

    schaefera

      I created an .AOP file, put the jboss-aop.xml file inside the META-INF directory and deployed it. I also changed the jboss-service.xml file inside the AOP deployer directory to enable loadtime weaving and also set verbose to true.
      Unfortunately none of my bean methods are instrumented or at least the Interceptor method is not called.

      Strangly enough I see the EJB3 being instrumented by in this list my binding file (jboss-aop.xml) file is not listed:

      2006-01-13 14:36:07,468 INFO [STDOUT] method matched binding execution(* *->*(..)) public final void java.lang.Object.wait() throws java.lang.InterruptedException
      2006-01-13 14:36:07,468 INFO [STDOUT] [debug] added advisor: jboss.j2ee:service=EJB3,name=com.madplanet.ejb3.helloWorld.HelloWorldEJB3 from binding: file:/C:/java/jboss.4.0.3.sp1.ejb3.rc3/server/gateway/tmp/deploy/tmp16838ejb3-interceptors-aop.xml0
      2006-01-13 14:36:07,468 INFO [STDOUT] iterate binding file:/C:/java/jboss.4.0.3.sp1.ejb3.rc3/server/gateway/tmp/deploy/tmp16838ejb3-interceptors-aop.xml2
      2006-01-13 14:36:07,468 INFO [STDOUT] iterate binding file:/C:/java/jboss.4.0.3.sp1.ejb3.rc3/server/gateway/tmp/deploy/tmp16838ejb3-interceptors-aop.xml4

      Only the ejb3-interceptors-aop.xml file is mentioned.
      In addition I tried to deploy the jboss-aop.xml by itself but no luck.

      Any ideas?

      Thanx - Andy

        • 1. Re: AOP Inside JBoss 4.0.3 with EJB3 does not work
          schaefera

          I could not make the loadtime weaving work but using the AOPC compiler I could make it work to run AOP within JBoss AS and EJB3 RC3.

          • 2. Re: AOP Inside JBoss 4.0.3 with EJB3 does not work
            kabirkhan

            Read all of chapter 10, but most importantly: http://docs.jboss.com/aop/1.3/aspect-framework/reference/en/html/running.html#d0e2812

            In the AOP distribution there is a tutorial example called "injboss" to explain how to package stuff and to help you verify that you have everything set up correctly

            • 3. Re: AOP Inside JBoss 4.0.3 with EJB3 does not work
              schaefera

              Ok, finally I could it work, somewhat.

              These were the steps:
              - adjust the jboss-aop-jdk50.deployer/META-INF/jboss-service.xml
              - set the MBean class to: 'org.jboss.aop.deployment.AspectManagerServiceJDK5'
              - set the 'EnableLoadtimeWeaving' to 'true'
              - copy the 'pluggable-instrumentor.jar' into the 'bin' directory
              - adjust the run.conf file so that JAVA_OPTS is extended this way:
              JAVA_OPTS="$JAVA_OPT -javaagent:pluggable-instrumentor.jar"
              - deploy the AOP file or the JAR archive and the *-aop.xml file
              - fire up JBoss and voila it does instrument it

              Now I just run into the snag that instrumenting code of the size of ~300KB does make JBoss run out of memory even though I set the minimum heap size to 512m and the maximum to 1024m. But I also disovered a similar problem with AOPC and had to run the instrumentation in multiple steps.

              -Andy