is there a way to run the servlet right after tomcat has started. i've tried to configure the web.xml file with load on startup but then tomcat doesn't finish starting because i have a while loop in my init method to accept connections. anyone got an idea how to do this?
Spwan a thread in the servlet loaded at tomcat startup. This won't stop execution of tomcat server.
posted 11 years ago
BAD. Your servlet would lock up Tomcat in that while loop forever from the moment you started it. At the very least make it thread-safe and have it yield regularly, that should solve your lock problems.