4 Replies Latest reply on Jun 26, 2003 4:38 PM by tim kitchens

    Can AOP be used with JBoss 3.2?

    tim kitchens Newbie

      I've tried the standalone version of JBoss AOP - very cool. I'm wondering whether it's possible to use JBoss AOP with JBoss 3.2.1 while we're waiting for the 4.0 release? I took a stab at it, but no luck so far. Has anyone tried this? I realize there are issues with the classloader, but I'm hoping someone knows some "trick" to get around this. I'm hoping to be able to implement an Interceptor to perform some metrics collection.

      Thanks,
      Tim

        • 1. Re: Can AOP be used with JBoss 3.2?
          Bill Burke Master

          Nope. UnifiedClassLoader changes would need to be backported. We will not be backmerging AOP to 3.2 branch since we avoid major features being introduced to a maintainence release.

          Bill

          • 2. Re: Can AOP be used with JBoss 3.2?
            tim kitchens Newbie

            Thanks for the quick reply, Bill. It's much appreciated. I figured that the classloading mechanism wasn't compatible, but figured I'd give it shot, just in case. I'll just use AspectJ for my needs while I await 4.0. I've looked at both AspectJ and JBoss AOP and, while AspectJ is pretty good, I found the JBoss implementation MUCH easier to understand and use. Look forward to using it in the future.

            Thanks,
            Tim

            • 3. Re: Can AOP be used with JBoss 3.2?
              salkadam Newbie

              Tim,
              Can you point me with any example or the setup issues with running jboss 3.2.1 with AspectJ.

              I tried wring aspects for some servlet and EJB in JBOSS, but i don't see them.

              Thanks for your help.
              Sal

              • 4. Re: Can AOP be used with JBoss 3.2?
                tim kitchens Newbie

                Sal,

                I've attached two aspects (actually, one is the super class that the other extends) that I developed for logging some metrics for our application. The only things I can think of that might be causing you problems are:

                1) Make sure that you've copied aspectjrt.jar to the JBoss classpath (i.e. $JBOSS_HOME/server/default/lib).

                2) Make sure that you're correctly specifying your pointcut (see attached source file).

                3) Make sure you're bundling both the aspect AND the classes specified by your pointcut so that they're loaded in the SAME CLASSLOADER. Not sure, but I seemed to have problems when the aspect and their corresponding "target" classes were loaded by different loaders. Need more research on this one, but it works fine for me as I've bundled them for now.

                Good luck,
                Tim