Tomcat failed to start when calling Thread.sleep inside servlet on server startup.
There is a Servet which is loaded at server start up. Inside the init method of servlet, sendMail method of MailSenderUtility class is called. Inside the sendMail method I have called Thread.sleep() method to sleep the program for a calculated time if it is not 8 PM.
Due to this code (Thread.sleep) server does not getting started. If I delete the Thread.sleep statement, it is working fine.
Please help and let me know if there is better way to do it. For your knowledge I can not use Quartz and Java Timer class for my scheduler due to some limitations.
Thank to you all for support.
Dheeraj