5 Replies Latest reply on Oct 29, 2004 11:15 AM by André Dantas Rocha

    Why it's not working?

    André Dantas Rocha Newbie

      Hi,

      I'm starting to work wih JBoss AOP...

      I' have two aspects:

      package aftt.weaving;
      
      import org.jboss.aop.joinpoint.MethodInvocation;
      
      public class MyInstrumentation {
      
       public Object invoke(MethodInvocation invocation) throws Throwable {
       Object result = null;
       try {
       System.out.println("Entering method: " + invocation.getMethod());
       result = invocation.invokeNext();
       }
       finally {
       System.out.println("Leaving method: " + invocation.getMethod());
       }
       return result;
       }
      
      }



      package aftt.weaving;
      
      public class MyAspect extends MyInstrumentation {
      
      }


      and a xml weaving file:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <aop>
       <bind pointcut="execution(public static boolean identifier.Identifier->verify(java.lang.String))">
       <advice name="instrument" aspect="aftt.weaving.MyAspect"/>
       </bind>
      </aop>


      When I try to weave I receive the following error:

      [Log4jListener.java:150] [error] advice instrument cannot find aspect aftt.weaving.MyAspect file:/D:/Eclipse/workspace/AFTT/projects/Teste-Identifier/instrumentation/weaving.xml


      What's wrong?

      Thanks,

      André