I had the similar issue but I already had @EnableScheduling
in place, in this case it was caused by miss-placing the @EnableScheduling automation.
The annotation apparently has to be placed on configuration class, so I moved it to configuration class and it works.
@AutoConfiguration
@EnableScheduling
class SomeConfigurationClass() {..}
class ClassWithScheduledTask() {
@Scheduled(fixedRate = 10, timeUnit = TimeUnit.Minutes)
fun thisIsScheduled() {..}
}
Worked also if the annotation was moved to the application class, but as the scheduler was shared among more apps, I found it more nice to have it on the configuration class.
@SpringBootApplication
@EnableScheduling
class SomeApp() {..}