title: @ControllerAdvice with @Autowired dependency not being injected
body: <p>Anyone knows how to inject a dependency to a @ControllerAdvice?</p>
  
  <p>My @ControllerAdvice extends Spring's ResponseEntityExceptionHandler and implements no interfaces.</p>
  
  <p>The @ControllerAdvice gets called correctly, but the @Autowired dependency is never injected.  There are no startup injection errors, the dependency is simply null.</p>
  
  <p>I guess it has to do with how Spring proxies the @ControllerAdvice with cglib so that the @Autowired annotation gets lost.</p>
  
  <p>I tested by implementing an interface, so that Spring could create a JDK proxy but it didn't work either. Actually with an interface, it didn't even gets called at all... even if I also annotate the interface with @ControllerAdvice.</p>
  
  <p>Is there a way to specify that Spring should use JDK proxies for that particular case?</p>
  
  <p>EDIT: I'm using Spring 3.2.4.RELEASE, by the way.</p>
  
  <p>Sample class:</p>
  
  <pre><code>@ControllerAdvice
  public class RestExceptionHandler extends ResponseEntityExceptionHandler {
  
      @Autowired(required = true)
      public AuditService auditService;
  
      @ExceptionHandler(value = { RuntimeException.class })
      public final ResponseEntity&lt;Object&gt; handleRuntimeException(Exception ex, WebRequest request) {
          // auditService is null here!
      }
  
  }
  </code></pre>