title: Aspectj ltw aop.xml
body: <p>How can we use aop.xml to define pointcuts in a plain java code? This is a sample code in which am trying to define the pointcut in aop.xml->
  1)This is the java class </p>
  
  <pre><code>package testAOP;
  
  public class HelloWorld {
  
          public static void main(String[] args) {
              HelloWorld app = new HelloWorld();
              app.say("Hello world!");
              app.add(11, 22);
          }
  
          private int add(int i, int j) { return i + j; }
          public void say(String message) { System.out.println(message); }
  }
  </code></pre>
  
  <p>2)My aspect class</p>
  
  <pre><code>package testAOP;
  
  abstract aspect MyAspect {
  
  
      protected abstract pointcut publicMethod();
  
      Object around() : publicMethod() {
          System.out.println(thisJoinPointStaticPart);
          return proceed();
      }
  }
  </code></pre>
  
  <p>3)Have created META-INF folder in the main project directory folder i.e. in package testAOP->META-INF which consists of the aop.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;aspectj&gt;
              &lt;aspects&gt;
          &lt;concrete-aspect
              name="testAOP.ConcreteAspect"
              extends="testAOP.MyAspect"
          &gt;
              &lt;pointcut
                  name="publicMethod"
                  expression="execution(public * testAOP.HelloWorld.*(..))"
              /&gt;
          &lt;/concrete-aspect&gt;
      &lt;/aspects&gt;
              &lt;weaver options="-verbose"&gt;
                &lt;weaver options="-showWeaveInfo"/&gt;
              &lt;/weaver&gt;
  &lt;/aspectj&gt;
  </code></pre>
  
  <p>Have added the METAINF folder having the <code>aop.xml</code> to the java build path and in the run configurations for Aspectj load-time weaving have set the following properties:</p>
  
  <ul>
  <li>In Main tab Project->HelloWorldPlainJava ,Main class->testAOP.HelloWorld</li>
  <li>In Arguments tab VM arguments->-javaagent:"D:\Eclipse_fldr\eclipse\plugins\org.aspectj.weaver_1.7.3.20130613144500-a.jar"</li>
  <li>In LTWclasspath tab in user entries have added HelloWorldPlainJava.</li>
  </ul>
  
  <p>What did i miss? WHy is not recognizing the pointcuts?</p>