title: Aspect is not being triggered in Spring Boot application
body: <p>I am developing an application with Spring Boot which I want it to have all the logging going through Aspects but I am not able to make it work.
  I set 2 methods with <code>@AfterThrowing</code> and <code>@Before</code>, this last one as testing. The pointcuts are inspecting the packages of Controller, Services and Repositories.
  The issue is that neither the log nor the <code>System.out.println()</code> is being shown in the console.</p>
  
  <p>I have tried the different solutions I have seen here but none of them worked for me. I have the right dependencies, no further configuration is needed because it is already done with Spring Boot and I even tried to  use the poincuts with the annotations of the classes.</p>
  
  <p>This is my package hierarchy</p>
  
  <p><a href="https://i.stack.imgur.com/7CSnc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7CSnc.png" alt="Packages"></a></p>
  
  <p><strong>Spring dependecies</strong></p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-aop&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>LoggingAspect</strong></p>
  
  <pre><code>package com.tlc.tracker.global.logging;
  
  import com.tlc.tracker.global.exception.BusinessServiceException;
  import lombok.extern.slf4j.Slf4j;
  import org.aspectj.lang.JoinPoint;
  import org.aspectj.lang.annotation.*;
  
  @Aspect
  @Slf4j
  public class LoggingAspect {
  
  @Pointcut("execution(* com.tlc.tracker.v01.controller.*.*(..))")
  public void controllerMethods() { }
  
  @Pointcut("execution(* com.tlc.tracker.v01.service.imp.ProjectServiceImpl.*(..))")
  public void serviceMethods(){  }
  
  @Pointcut("execution(* com.tlc.tracker.v01.repository.*.*(..))")
  public void respositoryMethods(){  }
  
  @Before("serviceMethods()")
  public void Areturn(JoinPoint point){
      System.out.println("Hola");
      log.info("HOLA");
  }
  
  @AfterThrowing(pointcut = "controllerMethods() &amp;&amp; serviceMethods() &amp;&amp; respositoryMethods()", throwing = "exception")
  public void logAfterThrowing(JoinPoint joinPoint, Throwable exception){
  
      if(exception instanceof BusinessServiceException){
          //Get the parts of the exception message
          String exceptions[] = exception.getMessage().split(":", 2);
          //Get the message contained in the exception message
          String message = exceptions.length == 1 ? "" : exceptions[1];
  
          log.error("[" + joinPoint.getSignature().getName() + "] - Type: " + exceptions[0] + ". Message: "+ message);
      }
  
      if(exception instanceof Exception){
          log.error("[" + joinPoint.getSignature().getName() + "] - Type: ServerError. Message: "  + exception.getMessage());
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>ProjectController</strong></p>
  
  <pre><code>@RestController
  @RequestMapping("/v01")
  @Slf4j
  public class ProjectController {
  
      @Autowired
      private ProjectServiceIface projectService;
  
      @PostMapping(path = "/project", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
      public ResponseEntity&lt;Project&gt; createProject(@Valid @RequestBody Project project, BindingResult result){
          if(result.hasErrors()){
              throw new BusinessServiceException(result.getFieldError().getDefaultMessage(), result.getFieldError().getField() + " " + result.getFieldError().getCode());
          }
          Project projectSaved = projectService.createProject(project);
          HttpHeaders headers = new HttpHeaders();
          headers.add("Location", projectSaved.getId().toString());
  
          return new ResponseEntity&lt;&gt;(project, headers, HttpStatus.CREATED);
      }
  }
  </code></pre>
  
  <p><strong>ProjectService</strong></p>
  
  <pre><code>@Service
  public class ProjectServiceImpl implements ProjectServiceIface {
  
      @Autowired
      private ProjectRepository projectRepository;
  
      @Override
      public Project createProject(Project project) {
          Project projectFound = projectRepository.findByName(project.getName());
          if(projectFound == null){
              throw new BusinessServiceException(Constants.FUNCTIONAL_ERROR, "The Project already exists");
          }
          project.setCreateTime(new Date());
  
          Project projectSaved = projectRepository.save(project);
          return projectSaved;
      }
  }
  </code></pre>
  
  <p><strong>ProjectRepository</strong></p>
  
  <pre><code>public interface ProjectRepository extends CrudRepository&lt;Project, Integer&gt; {
  
      @Query(value = "SELECT * FROM Project p WHERE p.name = :projectName", nativeQuery = true)
      public Project findByName(String projectName);
  }
  </code></pre>