Your project is in Tomcat's webapps directory? Not a good idea. I recommend that you place your project elsewhere.
It would appear that your Ant script is creating the file E:\apache-tomcat-5.5.27\webapps\JDBCServlet\WEB-INF\jar\JDBCMySQLServlet.war. As far as I know there is no way that Tomcat will ever recognize that file because it is not at the correct location. It would have to be located at E:\apache-tomcat-5.5.27\webapps\JDBCMySQLServlet.war.
Personally, after moving my project elsewhere, I would gather all the contents necessary to build the WAR file in one location. Then I would copy the contents of that directory to the E:\apache-tomcat-5.5.27\webapps\JDBCServlet directory. Tomcat should pick up the changes to your JSPs and static content. For changes to classes, such as servlets, you will probably have to restart Tomcat.
You can use the Ant "exec" task to run the shutdown and startup scripts for Tomcat in order to restart Tomcat.
For changes to classes, such as servlets, you will probably have to restart Tomcat.
Are you sure, we have to start tomcat can't we do hot deployment into the server. Hot deployment So what I thought was 1) We need to create a modified war file 2) We need to run the TCD's build.xml to deploy the modified war file into server, while the server is running. Is this correct? I tried out the same & even created a build.xml for TCD(TomcatClientDeployer) & tried running that but somehow it was not working fine.
3) In Java, whatever is inside jre/lib/ext folder the runtime environment identifies it, likewise is there any arrangement of that sort in Tomcat server so that we can put the modified war file there so that the server recognises it.
4) One more doubt is in some real-time applications when they want to change the application & deploy it, I've heard that they are following this approach of hot deployment so that the existing users don't suffer from the server shutdown.
Joined: Oct 06, 2008
To delete the file , I used the following attribute in my build.xml
Dear Martin need some clarifications as I don't understand your post .
Ideal scenario: I want to use Ant to deploy the new war file to the Tomcat server without shutting it down. Is it possible?
If not, Is it possible to use Ant to shutdown the server & start the server to deploy especially can we use that ant exec command for this. In that case if I make simple changes in my class file, then use of ant is sufficient.