Is it possible to programatically undeploy web applications(WARs specifically) from server. If the answer is yes, is the way to undeploy different for different servers.
I am specifically looking for undeploying from following servers
- Tomcat
- JBoss
- Jetty
- GlassFish
- Websphere
- Weblogic
- Geronimo
- Resin
- JOnAS
I know it may be a long answer if the way to undeploy is different across different servers. In that case I am more than happy to get some generic solution or pointers for this information
Sandeep,
I’m not aware of a standard, in-container way of one web-application undeploying another. My instinct is that the apps themselves are “contained” and the spec doesn’t intend for them to manage their container.
That said, most / all of these web containers provide APIs for deploying and undeploying web applications. The approaches are not common though, and when my development colleagues create a new integration for our uDeploy product, we have to research each in turn. For instance, with Tomcat you can use the Tomcat Manager APIs. You could use the open source Apache Ant tasks as an example of what you want to do: http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html#Executing_Manager_Commands_With_Ant
For Websphere, you are probably are writing jython scripts or doing some of your own programming against the JMX APIs. Weblogic is somewhere in-between as it provides some nice Ant scripts you could borrow, as well as direct APIs.
Good Luck!