3

Wondering is there is a way to generate notification when an application is deployed on Tomcat 6. Right now we use Tomcat Manager web interface to deploy our applications. We have two tomcat instances working in a load balanced mode with Apache in front of them. Would highly appreciate if anyone can throw more light on the same.

John C
  • 1,795
  • 4
  • 27
  • 42
  • 1
    Why not send your notification from the application being deployed, as discussed in [Is there a way to run a method/class only on tomcat startup?](http://stackoverflow.com/questions/158336)? – f_puras Aug 24 '12 at 09:19
  • Good link. This is helpful however instead of adding the notification code in 100 or so applications deployed on Tomcat, can i not do it at the server level in order to preserve duplication. – John C Aug 24 '12 at 16:49
  • I already imagined your question was not about a handful of applications. Maybe Tomcat Manager is not the right tool for your task... But isn't deployment just about stopping a webapp and copying a WAR to the right place? I could think of a server script performing the required steps (like [this](http://stackoverflow.com/questions/4432684)) and then sending a notification. – f_puras Aug 24 '12 at 21:52
  • One more idea: I know little about [JMX](http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html), but maybe [this](https://tomcat.apache.org/tomcat-6.0-doc/monitoring.html) also works for notifications. – f_puras Aug 31 '12 at 18:29
  • 1
    Have you managed to solve this? I have a similar workaround like the "server script" one, actually is another script... – Gaucho Jan 30 '13 at 18:41
  • @Gaucho: Nope, haven't solved it yet! Do you mind throwing more light on your script? – John C Feb 16 '13 at 19:50
  • Hi John, well, I do not like to much my solution but basically is to deploy using Tomcat Client Deployer ($ANT_HOME/bin/ant -buildfile $TOMCAT_DEPLOYER_HOME/bin/apache-tomcat-7.0.30-deployer/build.xml deploy -Durl=http://$HTTP_HOST:$HTTP_PORT/manager/text -Dusername=$MANAGER_USER -Dpassword=$MANAGER_CREDENTIALS -Dfile=/tmp/$APP_PATH -Dpath=/$APPNAME > dev/null) then check the output if [ $status = 1 ] ; then... – Gaucho Mar 22 '13 at 08:28

0 Answers0