79681448

Date: 2025-06-27 05:48:26
Score: 1
Natty:
Report link

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
@EnableSchedulingclass 
SomeApp() {..}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @EnableScheduling
  • User mentioned (0): @EnableScheduling
  • Low reputation (1):
Posted by: Filip Jeřábek