1

Is there anyway to write a hook to execute an ant script after the tomcat startup is completed. Tried to change the startup.bat to invoke ant script at the end, but the ant gets invoked before the tomcat has completely started.

Any thoughts will be greatly appreciated.

Ajai Gopal
  • 189
  • 4
  • 12
  • 1
    you can check: http://stackoverflow.com/questions/376279/wait-until-tomcat-finishes-starting-up – jhurtado Jun 06 '12 at 17:20
  • Thanks for the update. Can you provide few more inputs on the LifecycleListener implementation, so that I can invoke the necessary action from a Java class itself. – Ajai Gopal Jun 06 '12 at 17:44

1 Answers1

2

An easy way without dealing with anything related to Tomcat:

<!-- run tomcat here -->

<!-- wait for the server to be available -->
<waitfor>
    <http url="http://host:port">
</waitfor>

<!-- run other ant scripts from here... -->
Dante WWWW
  • 2,729
  • 1
  • 17
  • 33