How to run a background task in a servlet based web application?
Your problem is that you misunderstand the purpose of the servlet. It’s intented to act on HTTP requests, nothing more. You want just a background task which runs once on daily basis. EJB available? Use @Schedule If your environment happen to support EJB (i.e. a real Java EE server such as WildFly, JBoss, TomEE, Payara, … Read more