Well, it depends upon the purpose of startup tasks. If the startup task needs to use the resources started by the server, then the ServletContextInitializer is a right place.
Whereas, If the startup task needs just setting up some data,
testing some external connections (out side the
J2EE container), then these can go as part of run.sh