title: AspectJ doesnt work fine in Eclipse
body: <p>I tried to create a simple program in java.</p>
  
  <p>In the program I have:</p>
  
  <p>1) Person class - with annotated methods</p>
  
  <p>2) Aspect Class.</p>
  
  <p>Now what I'm trying to do is before the person name is setted, to print some data to a log file and to the console. </p>
  
  <p>So this is what I did:</p>
  
  <p><strong>Person Class</strong></p>
  
  <pre><code>package pack.bl;
  
  import org.springframework.stereotype.Component;
  import pack.aop.LogLevel;
  import pack.aop.TestAnnotation;
  
  @Component
  public class Person {
  
  private String name,dest;
  public Person(String name,String dest)
  {
      this.setName(name);
      this.setDest(dest);
  }
  
  public String getName() {
      return name;
  }
  
  @TestAnnotation(value=LogLevel.INFO)
  public void setName(String name) {
      this.name = name;
      System.out.println("Im " + this.toString() + " My name was changed to " + name);
  }
  
  public String getDest() {
      return dest;
  }
  
  @TestAnnotation(value=LogLevel.INFO)
  public void setDest(String dest) {
      this.dest = dest;
  }
  
  @Override
  public String toString()
  {
      return this.name + "\n";
  }
  
  public static void main(String[] args) {
      Person p = new Person("Person1","Kripton");
      p.setName("Person2");
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Aspect Class</strong></p>
  
  <pre><code>package pack.aop;
  
  import java.util.Arrays;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.aspectj.lang.JoinPoint;
  import org.aspectj.lang.Signature;
  import org.aspectj.lang.annotation.Aspect;
  import org.aspectj.lang.annotation.Before;
  import org.springframework.test.context.ContextConfiguration;
  
  
  @Aspect
  @ContextConfiguration(locations = {
          "applicationContext.xml"})
  
  public class BeforeAdvice {
  
  private Log logger = LogFactory.getLog("Logger");
  
  @Before("@annotation(testAnnotation)")
  public void myBeforeLogger(JoinPoint joinPoint,TestAnnotation testAnnotation)
  {
      System.out.println("Okay - we're in the before handler...");
      System.out.println("The test annotation value is: " + testAnnotation.value());
      Signature signature = joinPoint.getSignature();
      String methodName = signature.getName();
      String stuff = signature.toString();
      String arguments = Arrays.toString(joinPoint.getArgs());
      logger.info("Write something in the log... We are just about to call method: "
      + methodName + " with arguments " + arguments + "\nand the full toString: "
      + stuff);
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>ApplicationContext.xml file:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;beans xmlns="http://www.springframework.org/schema/beans"    
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xmlns:aop="http://www.springframework.org/schema/aop"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/aop 
              http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
      http://www.springframework.org/schema/beans 
              http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/context 
              http://www.springframework.org/schema/context/spring-context.xsd"&gt;
  
  &lt;aop:aspectj-autoproxy/&gt;
  
  &lt;context:component-scan base-package="pack.bl.Person"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>*<strong><em>NOTE:</strong> The <strong>LogLevel</strong> is an enum. so it need to work like that, when I'm running 
  the program and set the person name, first it's need to go to the 'BeforeAdvice' (because the setName, is annotated with <strong>@testAnnotation</strong>) method in the Aspect class, and execute this method.. after that it's need to comeback to the setName method and set the person name.</em>*</p>
  
  <p>and one more thing, the testAnnotation is an Annotation that I created</p>