1 Reply Latest reply on Jan 28, 2010 11:40 AM by flavia.rainone

    Deploying AOP in 5.1 with pojo cache

    sudeep575

      Sry..removed

        • 1. Re: Deploying AOP in 5.1 with pojo cache
          flavia.rainone

          Hi! Running Vehicle's main method with javaagent does not solves your problem, because the weaving is performed at runtime:

           

          <target name="war" depends="compile">  
                  <java classname="com.test.pojo.Vehicle" fork="true" >
                               <jvmarg value="-Xmx128M"/>
                               <jvmarg value="-javaagent:WebContent/WEB-INF/lib/jboss-aop.jar"/>
                               <jvmarg value="-Djboss.aop.path=WebContent/META-INF/pojocache-aop.xml"/>
                               <classpath refid="compile.classpath"/>       
                               <classpath path="build/classes" /> 
                           </java> 
                  <war destfile="dist/Cache.war" webxml="WebContent/WEB-INF/web.xml">
                      <fileset dir="WebContent"/>
                      <lib dir="WebContent/WEB-INF/lib"/>
                      <classes dir="build/classes"/>
                  </war>
              </target>
          

           

          This means that the class file in buid/classes is not instrumented, it is instrumented only in the memory of the JVM while executing Vehicle's main(). So, your Vehicle class file remains unchanged and that's why you're seeing that error in JBoss AS.

           

          You need to compile your Vehicle class with aopc instead. Take a look at our tutorial for a build.xml example of how to do that.