spring task Scheduled run twice

I encountered this issue 2 times. So want to record it. 1 -> component scan and xml bean definition The 1st time i have this problem is the bean which contains the ‘@Scheduled’ method is annotated with @Component and also registered in the applicationContext.xml. This would make the task being scheduled twice. 2 -> two…