Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design 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
Pie
Posts: 20967
31
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