Dear All, My intention is to use Ant to automate build, deployment,starting & stopping server of applications. Now I'm able to build the application through Ant. My build.xml is inside my application
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.
Regards.
ramya narayanan
Ranch Hand
Joined: Oct 06, 2008
Posts: 338
posted
0
To delete the file , I used the following attribute in my build.xml
For stopping, starting, undeploying, and deploying to Tomcat via Ant, you might want to consider trying out the following Ant tasks in the catalina-ant.jar file:
Certainly Edwin I'll certainly go through that link & I do hope it would be very useful for me. Anyhow thanks Edwin for sharing your ideas & time for me. Regards
ramya narayanan
Ranch Hand
Joined: Oct 06, 2008
Posts: 338
posted
0
Do we need to stop the server for this? I want to " deploy on the fly" i.e. when the server is running I need to deploy to it. Regards.
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.
See the post from Edwin above, it lists the Ant tasks you can use to start, stop, deploy, undeploy from Tomcat.
In theory you can just use the undeploy/deploy tasks while Tomcat is still running. However if you're paranoid like me you can use the stop and start tasks before/after you deploy.
ramya narayanan
Ranch Hand
Joined: Oct 06, 2008
Posts: 338
posted
0
Understood & thanks martin for your patient reply! Regards.