Link to home
Start Free TrialLog in
Avatar of ecuguru
ecuguru

asked on

Java: Die on error / detect frozen?

I'm still debugging a java application I wrote, that does a lot of work with databases.  Occasionally, I get a java heap error or local memory error.  Right now, it prints out the error message and the app just stops.  It doesn't die, it just sits there with the printed out error message.

I'm running the application from a batch file:
java -jar myapp.jar

Is there a way to setup the java environment, or the app, so that on error like heap/memory, kill the app?
Best thing i to find the bug and squash it, but for resiliency, I'd like to be able to keep the app running after crash.  If it exists, I can detect that and restart it (I think) by setting it up as a service in Windows.
ASKER CERTIFIED SOLUTION
Avatar of MicheleMarcon
MicheleMarcon
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Could you please elaborate on what type of error it is you're getting. Is it a windows error (windows msgbox popup)? Is it a java OutOfMemory exception that's thrown?
Avatar of ecuguru
ecuguru

ASKER

Java OutOfMemory exception indeed.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial