This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Starting/Stopping Tomcat windows service through Java

 
John Farrel
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am writing a system to deploy tomcat wars across multiple tomcat installations.
I have been undeploying with tomcat manager, copying the war and deploying with tomcat manager.

However, due to flakiness with tomcat, or the manager, I would also like to restart the tomcat windows service.

Is there some magic in tomcat manager to shutdown tomcat? Then the windows service would restart it.
Otherwise, are there any libraries for accessing a remote windows machine and start/stop services?

 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to me that the easiest method would be to use System.getRuntime().exec() to execute the Windows command to start and stop services. (Which I don't remember what they are, but I do remember that they exist.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic