title: Aspect execution not firing on method
body: <p>I am kinda new to Aspects and I am trying to surround a function with an aspect but I can't get it called.</p>
  
  <p>The method signature is as follows:</p>
  
  <pre><code>public &lt;T&gt; T get(String uri, List&lt;BasicNameValuePair&gt; nameValuePairs, final Class&lt;T&gt; clazz)
  </code></pre>
  
  <p>and it's defined in class with fully-qualified name:</p>
  
  <pre><code>com.X.Y.infrastructure.rest.RestClient
  </code></pre>
  
  <p>And the Aspect</p>
  
  <pre><code>@Aspect
  public class WebRequestTimeLoggerAspect {
     @Around("execution(* com.X.Y.infrastructure.rest.RestClient.get(..))")
     public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
      System.out.println("hijacked method : " + joinPoint.getSignature().getName());
      System.out.println("hijacked arguments : " + Arrays.toString(joinPoint.getArgs()));
      System.out.println("Around before is running!");
      Object ret = joinPoint.proceed(); 
      System.out.println("Around after is running!"); 
          return ret;
     }
  }
  </code></pre>
  
  <p>I just cant seem to find the problem.
  Everything is declared and spring loads both beans into the container.</p>
  
  <p>If possible. How do I add another function to the same execute deceleration?</p>
  
  <p>Thanks.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>So I have managed to do some progress, apparently I needed to Change project configuration to support Aspectj (in eclipse) but now I am getting the following error:</p>
  
  <pre><code>applying to join point that doesn't return void: method-execution(java.lang.Object com.X.Y.infrastructure.rest.RestClient.get(java.lang.String, java.util.List, java.lang.Class))
  </code></pre>
  
  <p>I will assume that i need to specify the return argument. I thought * will catch all, but that seems to be for void.</p>
  
  <p>So how does the point cut should look for generics like that?</p>
  
  <p>Thanks again</p>
  
  <p><strong>Another update</strong></p>
  
  <p>Following the comment I have added a return value to the method. But the aspect is still not firing.</p>
  
  <p>By request the spring configuration:</p>
  
  <pre><code>&lt;aop:aspectj-autoproxy /&gt;
  &lt;bean id="webRequestTimeLoggerAspect" class="com.X.Y.infrastructure.rest.WebRequestTimeLoggerAspect" /&gt;
  </code></pre>
  
  <p>And in fact I don't believe I need to declare a bean for that aspect because I have package scan. But just in case.</p>