title: Spring async doesn't work when implements AsyncConfigurer
body: <p>Having a Spring configuration class for async methods as:</p>
  
  <pre><code>@Configuration
  @EnableAsync(proxyTargetClass = true)
  @EnableScheduling
  public class AsyncConfiguration {
  
  @Autowired
  private ApplicationContext applicationContext;
  
  @Bean
  public ActivityMessageListener activityMessageListener() {
      return new ActivityMessageListener();
  }
  @Bean
  public TaskExecutor defaultExecutor()
  {
      ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
      threadPoolTaskExecutor.setCorePoolSize(10);
      threadPoolTaskExecutor.setMaxPoolSize(10);
      threadPoolTaskExecutor.setQueueCapacity(Integer.MAX_VALUE);
  
      return threadPoolTaskExecutor;
  }
  </code></pre>
  
  <p>All my <code>@Async</code>methods works as expected but if I implement <code>AsyncConfigurer</code>into <code>AsyncConfiguration</code> in order to catch exceptions implementing <code>getAsyncUncaughtExceptionHandler()</code> method, my beans are not being proxied so methods <code>@Async</code>doesn't run in a pool executor.</p>
  
  <p>This is the non-working configuration:</p>
  
  <pre><code>@Configuration
  @EnableAsync(proxyTargetClass = true)
  @EnableScheduling
  public class AsyncConfiguration implements AsyncConfigurer {
  
  @Autowired
  private ApplicationContext applicationContext;
  
  @Bean
  public ActivityMessageListener activityMessageListener() {
      return new ActivityMessageListener();
  }
  
  @Override
  public Executor getAsyncExecutor() {
      ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
      threadPoolTaskExecutor.setCorePoolSize(10);
      threadPoolTaskExecutor.setMaxPoolSize(10);
      threadPoolTaskExecutor.setQueueCapacity(Integer.MAX_VALUE);
  
      return threadPoolTaskExecutor;
  }
  
  @Override
  public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler()        {
      return new SimpleAsyncUncaughtExceptionHandler();
  }
  </code></pre>
  
  <p>What could be happening? </p>
  
  <p>We are using <code>@Async</code> like this:</p>
  
  <pre><code>public class ActivityMessageListener extends BaseMessageListener {
  
  public static final String PARAM_USER_ID                = "userId";
  public static final String PARAM_COMPANY_ID             = "companyId";
  public static final String PARAM_CREATE_DATE            = "createDate";
  public static final String PARAM_CLASS_NAME             = "className";
  public static final String PARAM_CLASS_PK               = "classPK";
  public static final String PARAM_TYPE                   = "type";
  public static final String PARAM_EXTRA_DATA             = "extraData";
  public static final String PARAM_RECEIVED_USER_ID       = "receiverUserId";
  
  @Override @Async(value = "defaultExecutor")
  public Future&lt;String&gt; doReceive(Message message) throws Exception {
  
      String name = Thread.currentThread().getName();
      Map&lt;String, Object&gt; parameters  = message.getValues();
      Long userId                     = (Long)parameters.get(ActivityMessageListener.PARAM_USER_ID);
      Long companyId                  = (Long)parameters.get(ActivityMessageListener.PARAM_COMPANY_ID);
      Date createDate                 = (Date)parameters.get(ActivityMessageListener.PARAM_CREATE_DATE);
      String className                = (String)parameters.get(ActivityMessageListener.PARAM_CLASS_NAME);
      Long classPK                    = (Long)parameters.get(ActivityMessageListener.PARAM_CLASS_PK);
      Integer type                    = (Integer)parameters.get(ActivityMessageListener.PARAM_TYPE);
      String extraData                = (String)parameters.get(ActivityMessageListener.PARAM_EXTRA_DATA);
      Long receiverUserId             = (Long)parameters.get(ActivityMessageListener.PARAM_RECEIVED_USER_ID);
      ActivityLocalServiceUtil.addActivity(userId, companyId, createDate, className, classPK, type, extraData, receiverUserId);
  
      return new AsyncResult&lt;String&gt;(name);
  }
  }
  </code></pre>