0 Replies Latest reply on Feb 23, 2012 9:36 AM by mksong

    Deploying problem of a JBoss AOP aspect in JBoss AS 5.1

    mksong

      Hello,

       

       

      I just wanted to test the deployment of a simple JBoss AOP aspect program to work with a simple Servlet in JBoss Server.

      I downloaded "jboss-5.1.0.GA-jdk6.zip", and tested it on Ubuntu 10.10 and cygwin.

       

      Here is what I did refereeing the tutorial, but I couldn't find any appropriate solution to solve the problem with which I faced in this forum.

       

      # vi $JBOSS_HOME/server/default/conf/bootstrap/aop.xml
      <property name="enableLoadtimeWeaving">true</property> 
      
      # vi $JBOSS_HOME/bin/run.sh
      JAVA_OPTS="-Dprogram.name=$PROGNAME $JAVA_OPTS -javaagent:pluggable-instrumentor.jar"
      
      # cp $JBOSS_HOME/server/default/deployers/jboss-aop-jboss5.deployer/pluggable-instrumentor.jar .
      
      # jar cvf servlet-example.war -C servlet-example WEB-INF 
      
      # jar cvf aspect.aop -C aspect com -C 2aspect META-INF 
      
      # place aspect.aop and servlet-example.war in $JBOSS_HOME/server/default/deploy/
      
      # http://localhost:8080/example/servlet
      OK. 
      

       

      Attached is all materials, and I added here the code snipets.

      # jboss-aop.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <aop xmlns="urn:jboss:aop-beans:1.0">
      <interceptor class="com.jboss.aspect.MethodInterceptor"/>
       <bind pointcut="execution(protected * com.example.*->doGet(..))">
       <interceptor-ref name="com.jboss.aspect.MethodInterceptor"/>
       </bind>
      </aop>