cron - How do handle Java runtime errors when running as a cronjob -


I am running Java standalone jobs as a kronobose. I noticed that in some rare instances, the job will fail with an outtime error like runtime exception. Crown's MAIL_TO handler does not appear to be taking a job failure and the Java application is unable to do anything explicitly, because of the memory error the execution stopped.

What will be the best practice to complete such behavior is errors and cron alerts? The closest I could think was that every Java job writes a "success" -log record and then chains up a grap in the cronbage and returns an error code so that the MAIL_TO of the Kroon raises it. This is then clearly the chronology of clutter and obviously code change is needed to write a log entry.

JVM, the process associated with it) exits the exit code 1, when an exception exception to the main Makes the thread its way, which does not handle it.

So, all your exception exceptions to one option are caught in main () and using something like system.exit () (Do not exit after 0, because it is "standard" for success), and the exit code which has the cron script (for example using the $? variable) Handle it)

Also, do not forget that stack traces go by default on stderr.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -