Wait until tomcat finishes starting up
It's not hard to implement programaticaly. You can implement org.apache.catalina.LifecycleListener and then you'll have
public void lifecycleEvent(LifecycleEvent lifecycleEvent) { if(lifecycleEvent.getType().equals(Lifecycle.START_EVENT)) //do what you want } }
in web.xml :
<Context path="/examples" ...>...<Listener className="com.mycompany.mypackage.MyListener" ... >...</Context>
Please notice that some things could differ between 6-9 Tomcats.