You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by SiSi'mon <s_...@purpleblade.net> on 2007/05/22 20:11:33 UTC

How to programatically undeploy an application (war)?

When tomcat is starting up I want to undeploy a war if there there is any
exception of any kind thrown in the war.  For example if there is a
hibernate exception, spring exception or an exception I throw, then I want
to not continue and either shut down tomcat (System.exit) or undeploy the
war.

I have noticed that if a MyFaces jsf exception is thrown, it will continue
to deploy the war.  I want to stop at the first failure.

thanks
-- 
View this message in context: http://www.nabble.com/How-to-programatically-undeploy-an-application-%28war%29--tf3798261.html#a10744453
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to programatically undeploy an application (war)?

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Interesting question....
Dont think you can tell Tomcat to throw it out... but here are some 
idea's...
+ Have a look at this embedding article... maybe that deployer will show all 
exceptions and you can filter them.... (I dont know).... then before tomcat 
is started you could let them run an integrity test (embedded tomcat in same 
location) ... maybe, these are just idea's.
http://www.onjava.com/pub/a/onjava/2002/04/03/tomcat.html

+ If you have a main servlet... or JSP... architecture depending... do your 
own forname(class) checks on the required classes... if you dont find 
them... get the real path and delete the web-app... or rename it to 
"screwed".... or better still redirect all requests to "SOS.html"..or just 
delete the web.xml file..or use System.Exec to call the stop script file..
I like this kinda idea... can have one integrity servlet that does nothing 
but check the app on startup... remember to start the integrity servlet on 
startup.

Good luck... tell us how u made your "I'm outa here because I'm broken- 
WebApp" in the end... good stuff.



----- Original Message ----- 
From: "SiSi'mon" <s_...@purpleblade.net>
To: <us...@tomcat.apache.org>
Sent: Tuesday, May 22, 2007 8:11 PM
Subject: How to programatically undeploy an application (war)?


>
> When tomcat is starting up I want to undeploy a war if there there is any
> exception of any kind thrown in the war.  For example if there is a
> hibernate exception, spring exception or an exception I throw, then I want
> to not continue and either shut down tomcat (System.exit) or undeploy the
> war.
>
> I have noticed that if a MyFaces jsf exception is thrown, it will continue
> to deploy the war.  I want to stop at the first failure.
>
> thanks
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-programatically-undeploy-an-application-%28war%29--tf3798261.html#a10744453
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org