5

I'm experiencing an issue with a java application I'm trying to run as a Windows service via Apache procrun.

The application is made up of 2 components, a java component where the main part of the application resides. And a C component which enables the java application to communicate to some hardware. The interface between the two uses the Java Native Interface (JNI).

In the event that there is a crash in the C component the whole JVM is brought down too. This however in procrun this gets returned as a "VM exit code: 0". (see bellow)

[2013-06-27 11:55:47] [debug] ( prunsrv.c:1528) [ 8488] Waiting for worker to finish...
[2013-06-27 11:55:55] [debug] ( javajni.c:964 ) [ 5716] Java Worker thread finished applicationName/core/applicationNameCore:main with status=0
[2013-06-27 11:55:55] [debug] ( prunsrv.c:1533) [ 8488] Worker finished.
[2013-06-27 11:55:55] [debug] ( prunsrv.c:1559) [ 8488] Waiting for all threads to exit
[2013-06-27 11:56:46] [debug] ( prunsrv.c:919 ) [10160] Start exit hook called ...
[2013-06-27 11:56:46] [debug] ( prunsrv.c:920 ) [10160] VM exit code: 0
[2013-06-27 11:56:46] [debug] ( prunsrv.c:844 ) [10160] reportServiceStatusE: 1, 0, 0, 0

Which means that Windows Service thinks the service has shutdown safely and does not attempt to restart the service using the Service Recovery Events.

Ideally I need procrun to be able to detect that the JVM has crashed. And return a suitable error code. This would enable Windows to detect the error, and be able to restart the service.

I have gone through the Procrun documentation and there is no mention of being able to restart the JVM internally to Procrun. However on their ticketing system there is mention of such a feature:

https://issues.apache.org/jira/browse/DAEMON-301

Does anyone know if this feature is yet to be implemented? or is it present and simply not documented?

Any other advice regarding this issue would be most appreciated too.

0 Answers0