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.