title: How to use AOP in WildFly 8.2
body: <p>I would like to log the execution time for some methods in my controllers.<br>
  Right now I am just trying to figure out so I don't log but print, and it's for all methods.<br>
  I have a Profiler class:</p>
  
  <pre><code>@Aspect
  public class Profiler {
  
      @Pointcut("execution(public * *(..))")
      public void methods() {}
  
      @Around("methods()")
      public Object logExecutionTime(ProceedingJoinPoint joinPoint) throws Throwable {
          long start = System.currentTimeMillis();
          Object result = joinPoint.proceed();
          System.out.println(joinPoint.getSignature() + " " + (System.currentTimeMillis() - start));
          return result;
      }
  }
  </code></pre>
  
  <p>My pom.xml contains aspectjrt version 1.8.5<br>
  I don't use Spring.</p>
  
  <p>I tried dozens of combinations of annotations like @Provider, @ApplicationScoped, @Initialized(ApplicationScoped.class), @Named.<br>
  I tried to use javax.ws.rs.core.Application, jboss-aop.xml, etc.<br>
  Nothing works (but no errors) :-(</p>
  
  <p>Thanks for your help.</p>