commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ning Li" <Ning...@businessobjects.com>
Subject prunsrv - window service get restarted all the time
Date Wed, 01 Nov 2006 20:10:18 GMT
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message