Using @Scheduled and @EnableScheduling but gives NoSuchBeanDefinitionException

according to exception Info Could not find default TaskScheduler bean, the config should define TaskScheduler rather than “Executor”

@Configuration
public class AppContext extends WebMvcConfigurationSupport {
    @Bean
    public TaskScheduler taskScheduler() {
        return new ConcurrentTaskScheduler();
    }

    // Of course , you can define the Executor too
    @Bean
    public Executor taskExecutor() {
        return new SimpleAsyncTaskExecutor();
   }
}

Leave a Comment

techhipbettruvabetnorabahisbahis forumu