Hi,
I am using prunsrv.exe to run my Java app as a windows service, I configured the windows service recovery policy as "restart the service" for service failure. In my java Main() method, some conditions have to meet, otherwise it will call System.exit(0), and shutdown the app. But it seems that prunsrv won't be able to detect that the Java app has stopped normally, inside prunsrv.c, apxJavaStart(hWorker) method will succeed and the service will be marked as running, when it goes to apxJavaWait(hWorker, INFINITE, FALSE)method, prunsrv.exe suddenly abort without even return from that method. Then windows will try to restart the service again and again. If I let apxJavaStart(hWorker) method returns a failure, prunsrv.exe seems handle everything properly, and windows won't try to restart the service again. But the problem is I cannot find a way for prunsrv.exe to detect Java app has exit, and fail the apxJavaStart(hWorker) method. Is this a known issue? How can I workaround the problem? Thanks Ning
