java.lang.IllegalStateException: Unexpected use of scheduler.
在启动类加:
@Bean public ThreadPoolTaskScheduler taskScheduler(){ ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler(); taskScheduler.setPoolSize(10); taskScheduler.initialize(); return taskScheduler; }