Issue
I have read a few posts on these issues but it did not fix the problem.
@Component
@EnableScheduling
public class NotificationScheduled {
@Scheduled(cron = "0 0/5 * * * ?")
public void email() {}
}
I tried adding spring.batch.job.enabled=false
in the application property file but did not work.
I also read https://docs.spring.io/spring-framework/docs/3.0.x/reference/scheduling.html#scheduling-annotation-support-scheduled section 25.5.1
I am running scheduler for every 5 min. When scheduler is kicked of (5 is up), it calls the method twice right away. Please help as I am running out of options. Thank you
As soon as I start tomcat (8.5), I see two scheduling thread. Could it tomcat?
UPDATE - I was able to fix the by removing the following line from tomcat config/server.xml. This line was deploying my app twice. I was able to see that from tocat manager. <Context docBase="myapp path="/myapp" reloadable="true" source="org.eclipse.jst.jee.server:myapp"/>
Thank you all for your inputs.
Solution
I was able to fix the by removing the following line from tomcat config/server.xml. This line was deploying my app twice. I was able to see that from tocat manager. <Context docBase="myapp path="/myapp" reloadable="true" source="org.eclipse.jst.jee.server:myapp"/>
Thank you all for your inputs.
Answered By - Meera