1 Reply Latest reply on Jul 22, 2005 10:41 AM by markusydkvist

    deploying aop and spring beans

    markusydkvist

      Folks!
      I've been strugling for two days now, and I find no way of making this work:

      A simple web-app with spring-beans. So far, all fine. Ok, so I want to add some advices to some of my spring-beans. Trouble. Ok, I could use spring-aop, but I really want to use Jboss-aop, wich I find much more competent.

      What really puzzles me it the classloading stuff. In all tutorials of jboss-aop, it says that I could basically drop a xxx-aop.xml in my deploy. (after enabling load-time-weaving in AspectManager). After that I deploy my war. That really doesn't do it for me...

      So I build an ear, with:

      /META-INF/application.xml
      some.aop
      . . |
      /META-INF/jboss-aop.xml
      /META-INF/lib/3pp.jar //spring, log4j etc
      /mypackage/myClass.class //my own stuff, incl. my aspects,servlets
      some.war
      . . |
      index.jsp
      /META-INF/web.xml & jboss.xml
      /META-INF/lib/3pp.jar //spring, log4j etc
      /mypackage/myClass.class //my own stuff, incl. my aspects,servlets


      so I realize I have duplicated my 3pp's and own stuff. But really, I've tried all combinations of this, and I just can't seem to make it work in all cases, and it seems to me that either no weaving takes place, or if it does, I get in trouble when 3pp's are loaded: javassist.NotFound

      Does Spring have its own classloading mechanisms that conflicts with jboss-aop?

      Anyone that could point out a good resource for reading exactly how to package complex builds, how to use the manifest:class-path etc??

      regards
      /Marcus

        • 1. Re: deploying aop and spring beans
          markusydkvist

          Ok, no replies so far, but I managed to work my way around it.

          Like always, some time in the docs, plus double that amout of time of trial&error usually solves these kind of troubles... ;-)

          I now deploy all 3pp's separately as jars, and can now see them in the UnfiedRepository3 mbean. (That particular bean is very helpful in these cases).

          So:
          enable loadtime weaving (turned on verbose)
          spring.jar, x.jar ... -> deploy
          myApp.aop -> deploy (aspects classes and META-INF/jboss-aop.xml)
          myApp.war -> deploy (servlet, views, spring beans & spring xml)

          when I first visit my jsp's I get A LOT of loadtime info from the aop-enabled classloader.
          Then it works, my spring beans are intercepted by JBoss aop framework.


          /Marcus