2 Replies Latest reply on Sep 7, 2006 5:25 AM by mad11max

    Implementing AspectJ in JBoss/EJB

    imsathya

      Hello,

      I am very new to JBoss - and EJB. So this might be a very naive question.

      Here is the scenario :
      - I have a simple Person.jar which contains deployable EJBs - I need to deploy this with JBoss
      - I have created some aspects in AspectJ for performance monitoring of some of the beans which is AspectPerson.jar.

      Now, how do I deploy this with JBoss 3.0.25 ? Do I just add the AspectJ-required run-time parameters to the run.sh file ? I tried but it doesnt seem to work. The aspects do not get invoked. Any pointers, any documentation would be most helpful.

      Thanks.

        • 1. Re: Implementing AspectJ in JBoss/EJB
          peterb

          it's pretty easy:
          * Compile your classes with the AspectJ compiler and packages them as you usually do.
          * Put the aspectjrt.jar somewhere in the classpath ... the easiest would be the lib dir of your server.

          I'm not sure what kind of parameters you want to pass. It looks like you are using code compiled with javac instead of ajc. AspectJ doesn't do runtime weaving so you have to precompile the aspects into the code.

          • 2. Re: Implementing AspectJ in JBoss/EJB
            mad11max

            You can even use the lib directory in WEB-INF, so you dont have to put in the lib directory of the server
            ( I use Jboss 4.0.1)