This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Starting/stopping Tomcat 5.5 from Ant 1.6.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Starting/stopping Tomcat 5.5 from Ant 1.6.2" Watch "Starting/stopping Tomcat 5.5 from Ant 1.6.2" New topic

Starting/stopping Tomcat 5.5 from Ant 1.6.2

Giovanni De Stefano
Ranch Hand

Joined: Aug 17, 2004
Posts: 153
Hi guys!
I start/stop Tomcat 5.5 from Ant 1.6.2 using the following tasks:

This works but I have a few questions:
1. is there any better solution?
2. is it possible not to print in output all those messages that come from the execution of the jar?
3. is there a way to check from Ant if Tomcat is already running or not? I asked this because now my start-tomcat task depends on stop-tomcat, but if the server is NOT running when the stop-tomcat is executed I get error messages (and then the build continues).

Thank you in advance
Giovanni :-)
[ April 07, 2005: Message edited by: Giovanni De Stefano ]

SCJP 1.4
Vinayak patil
Ranch Hand

Joined: Aug 30, 2005
Posts: 67

I am deploying my application after shutting down tomcat and restarting it later. I tried out your method and had a problem this approach, in that tomcat threw an error that it was unable to find the java compiler in order to compile my jsps.

I have tried the <exec> task of ant and it works fine for me

Can anyone let me know why I was getting the error using the earlier approach and if it is advisable to use <exec> instead of <java>

Thanks in advance

"I can resist everything except temptation"
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Starting/stopping Tomcat 5.5 from Ant 1.6.2
It's not a secret anymore!