Caused by: java.lang.IllegalStateException: Only one AsyncConfigurer may exist
<p>I am trying to get two ThreadPoolTaskExecutor by implementing AsyncConfigurer.</p>

<p>When I starting my application getting this exception:</p>

<p>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.annotation.ProxyAsyncConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalStateException: Only one AsyncConfigurer may exist
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]</p>

<p>Caused by: java.lang.IllegalStateException: Only one AsyncConfigurer may exist
    at org.springframework.scheduling.annotation.AbstractAsyncConfiguration.setConfigurers(AbstractAsyncConfiguration.java:68) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]</p>

<pre><code>@EnableAsync
@Import({ Thread1.class, Thread2.class})
public class Test {


    public static void main(String[] args) {
        SpringApplication.run(Test.class, args);
    }
}

@Configuration
class Thread1 implements AsyncConfigurer{

    @Override
    @Bean(name="executor1")
    public Executor getAsyncExecutor() {
    }

    @Override
    public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
        // TODO Auto-generated method stub
        return null;
    }

}
@Configuration
class Thread2 implements AsyncConfigurer{

    @Override
    @Bean(name="executor2")
    public Executor getAsyncExecutor() {
    }

    @Override
    public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
        // TODO Auto-generated method stub
        return null;
    }
}

@RestController
@RequestMapping("/")
public class EmployeeController {

    @Autowired
    EmployeeService empService;

    @RequestMapping(value="/list/", method = RequestMethod.GET)
    public List&lt;Employee&gt; getEmpDetails() throws Exception {
        return empService.getALlEmpl();
    }

}
@Service
public class EmployeeService {
    @Async("executor1")
    public List&lt;Employee&gt; getEmpDetails(){
    }

    @Async("executor2")
    public Employee getCompanyDetail(String id){
    }

}   
</code></pre>

<p>Can somebody take a look at it ? Thanks a lot !</p>