title: Spring 4 - run method after server starts
body: <p>I need to run some code just after server starts. I used ServletContextListener and it worked good, however... it run the code before server started. Because of that I got the timeout exception on server as it cannot start because my method is still running. There is no point in increasing the timeout time as this method takes about 1 hour. What should I do?</p>