aspose file tools
The moose likes Tomcat and the fly likes autorestart tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "autorestart tomcat" Watch "autorestart tomcat" New topic
Author

autorestart tomcat

gana rajan
Greenhorn

Joined: Feb 13, 2012
Posts: 16
i need a script for tomcat restart at specified time by a user which able to run in any platform. it should be OS independent.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Not going to happen. The reason is simple - there is no uniform way of starting and stopping Tomcat, no uniform syntax for the scripts to do this and no uniform way of scheduling jobs.

And you should know that even if such a script would be possible, we are NotACodeMill and wouldn't just provide it like that.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
gana rajan
Greenhorn

Joined: Feb 13, 2012
Posts: 16
i've create batch file which run on windows and sh file which run on linux. i did not ask you to provide the full coding. but, ask you to show me the way on how to do it.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2407
This could involve a cron job that runs every 5 minutes and checks whether the Tomcat process is still alive, and restarts it if it isn't.

Edit: just saw that the title is actually somewhat different than the question behind it. My answer would thus be simplified to: This could involve a cron job (or a Windows Scheduler task if running on Windows).
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

gana rajan wrote:i've create batch file which run on windows and sh file which run on linux. i did not ask you to provide the full coding. but, ask you to show me the way on how to do it.

And you've shown yourself there is no OS independent way, as you've already had to create two separate batch files.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: autorestart tomcat
 
Similar Threads
Form Based secruity...
Tech Word Game
WA #1.....word association
Apache tomcat and Jakarta tomcat
How to deploy a web application ?