Failover mechanism in a core java application

My application is developed in core java. Can you please suggest me or provide me any links to what needs to be done to restart my application in case of any failovers?Thanks in advanceGaurav
[212 byte] By [GauravDeva] at [2007-11-27 7:00:49]
# 1
You could use a shutdown hook (class Runtime) or simply programatically re-set your app...
CeciNEstPasUnProgrammeura at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 2

that wouldn't ensure clean restart after JVM crashes though (or hardware failure, which causes an abnormal JVM termination).

For that you need some sort of mechanism for the application to constantly keep track of where it is and a way to continue halfway through a compound unit of work.

jwentinga at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 3
do i need a process monitor?
GauravDeva at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 4
> do i need a process monitor?Why do you want to do this? What type of application is it? What should happen on a crash?
kajbja at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 5
It is a middleware transaction server. The server should start in case of any failovers,JVM crashes.
GauravDeva at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 6
> It is a middleware transaction server. The server> should start in case of any failovers,JVM crashes.What do you mean by failovers? I'm sorry for asking this, but do you know what failover means? A failover means that another instance has taken over.
kajbja at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 7
sounds like he wants something that monitors his application and restarts it automatically when it crashes.Maybe something like Nagios combined with a shellscript to parse the output and a cronjob to run that shellscript every few minutes?
jwentinga at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 8

> sounds like he wants something that monitors his

> application and restarts it automatically when it

> crashes.

I agree.

@Op. Google on process watchdog.

>

> Maybe something like Nagios combined with a

> shellscript to parse the output and a cronjob to run

> that shellscript every few minutes?

Nagios ca be good, but at watchdog is probably better than the cron job.

kajbja at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 9

Sorry i used the word failover incorrectly. Thanks for correcting n understanding the prob.

I dont know whether i should use any monitoring tool or not, can u suggest me any other way. Can i use JMX here? If i use JMX then iam afraid i have to make changes in the existing code.

Pls advise.

GauravDeva at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...
# 10

> Sorry i used the word failover incorrectly. Thanks

> for correcting n understanding the prob.

> I dont know whether i should use any monitoring tool

> or not, can u suggest me any other way. Can i use JMX

> here? If i use JMX then iam afraid i have to make

> changes in the existing code.

> Pls advise.

Use a process watchdog.

kajbja at 2007-7-12 18:51:37 > top of Java-index,Java Essentials,Java Programming...