Using jsl_static.exe from jsl.0.99k, I've wrapped my java application as a windows service. In my java application I've a shutdown hook registered. The service starts and stops cleanly when done so from control panel. In each shutdown instance the shutdown hook is invoked.
However, sometimes the service stops unexpectedly with event id of 7031. I've seen service stop after 10 minutes, 30 minutes and sometimes after over an hour later. Looking at my application logs, I can see the shutdown is invoked in this scenario as well. I'm at loss as to why the unexpected shutdown happens. Could you provide some ideas or directions to troubleshoot this further?
The unexpected shutdown was happening because -Xrs was not passed to VM, as a result when user logged off the JVM was existing. With addition of -Xrs the problem was solved.