users@glassfish.java.net

Re: How to use -XX:OnOutOfMemory with GlassFish

From: <glassfish_at_javadesktop.org>
Date: Tue, 12 May 2009 09:19:56 PDT

I'd agree with Larry.

- For single instance case, you can use something like SMF which will restart the domain when it abruptly fails (e.g. see asadmin create-service command).

- For cluster case, the node-agent will take care of restarting failed instances.

The only slight problem is I don't know of a way of restarting the instance/domain only if it fails and the JVM process exits with a known exit-code. The above two ways will restart the entities regardless of exit-code the JVM exits with.

Maybe v3 has better support for this, because v3 can be started with "java -jar glassfish.jar"
and then you can monitor the returned process's pid and monitor it in a shell script.

Hope that helps.

-Kedar
[Message sent by forum member 'km' (km)]

http://forums.java.net/jive/thread.jspa?messageID=345972