wood burning stoves 2.0*
The moose likes Tomcat and the fly likes autorestart tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
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: 19679
    
  18

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 - OCEEJBD 6
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: 2408
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: 19679
    
  18

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://aspose.com/file-tools
 
subject: autorestart tomcat