title: @ControllerAdvice Not Firing
body: <p>I'm working on a Spring MVC/Webflow Application (version 3.2) and trying to get exception handling working where I can output a custom exception message to a logfile and error.jsp. The problem I'm having is that the Exception Handler is not getting fired. I've created the following class and annotated it "<code>@ControllerAdvice</code>" and put it into the same package as my controller that is throwing the exception:</p>
  
  <pre><code>@ControllerAdvice
  public class MyCustomExceptionController {
  
      @ExceptionHandler(MyCustomException.class)
      public ModelAndView handleMyException(MyCustomException ex) {   
          ModelAndView modelAndView = new ModelAndView();
          modelAndView.setViewName("/error/error");
          modelAndView.addObject("errorId", ex.getErrorId());
          modelAndView.addObject("message", ex.getErrorMessage());        
          return modelAndView;
      }
  }
  </code></pre>
  
  <p>and added the following to the mvc-config File:</p>
  
  <pre><code>&lt;mvc:annotation-driven/&gt;
  </code></pre>
  
  <p>And included the following in my app-config File:</p>
  
  <pre><code>&lt;context:component-scan base-package="package containing my controllers and MyCustomExceptionController"&gt;
          &lt;context:include-filter type="annotation" 
      expression="org.springframework.web.bind.annotation.ControllerAdvice" /&gt;
      &lt;/context:component-scan&gt; 
  </code></pre>
  
  <p>Any ideas why this isn't working?</p>